1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 11:04:00 +03:00

Use the convenience constructor.

This commit is contained in:
Rob Rix 2015-10-23 11:44:00 -04:00
parent aca676dd04
commit f4a9053977

View File

@ -45,7 +45,7 @@ public struct Interpreter<Term: CofreeType> {
// If both terms are equal, we dont need to bother diffing.
//
// In that case, zip the two terms together (to pair their annotations), and then map the resulting `Term` (which, since the terms are equal, will be non-nil) into a `Diff`.
if equal(a, b) { return hylo(Diff.Roll, Cofree.eliminate)(Term.zip(a, b)!) }
if equal(a, b) { return Diff(Term.zip(a, b)!) }
guard comparable(a, b) else { return nil }
let algorithm: Algorithm<Term, Diff>