1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 00:44:57 +03:00

Explicitly convert the bounds to Int.

This commit is contained in:
Rob Rix 2015-11-05 15:40:33 -05:00
parent db79154bdd
commit 3f5812bef5

View File

@ -21,7 +21,7 @@ public func SES<Term, Leaf, Annotation>(a: [Term], _ b: [Term], cost: Free<Leaf,
// A matrix whose values are streams representing paths through the edit graph, carrying both the diff & the cost of the remainder of the path.
var matrix: Matrix<Stream<(Diff, Int)>>!
matrix = Matrix(width: a.count + 1, height: b.count + 1) { i, j in
matrix = Matrix(width: Int(a.count.toIntMax() + 1), height: Int(b.count.toIntMax() + 1)) { i, j in
// Some explanation is warranted:
//
// 1. `matrix` captures itself during construction, because each vertex in the edit graph depends on other vertices. This is safe, because a) `Matrix` populates its fields lazily, and b) vertices only depend on those vertices downwards and rightwards of them.