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

Factoring.

This commit is contained in:
Rob Rix 2015-10-14 15:46:19 -04:00
parent 3117d26464
commit b60abdf5b0

View File

@ -127,11 +127,7 @@ extension Algorithm where Term: Equatable, B: FreeConvertible, B.RollType == Ter
extension Algorithm where Term: Categorizable, B: FreeConvertible, B.RollType == Term.LeafType, B.PureType == Algorithm<Term, B>.Patch {
public func evaluate(equals: (Term, Term) -> Bool) -> B {
return evaluate(equals, recur: {
($0.categories.isEmpty || $1.categories.isEmpty) && !$0.categories.intersect($1.categories).isEmpty
? Algorithm($0, $1).evaluate(equals).free
: nil
})
return evaluate(equals, categorize: { $0.categories })
}
}