1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 17:59:10 +03:00

Parameterized Patch equality.

This commit is contained in:
Rob Rix 2015-10-02 16:49:04 -04:00
parent 9a19d477df
commit ca6392e636

View File

@ -9,3 +9,13 @@ public enum Patch<A> {
}
}
}
// MARK: - Equality
extension Patch {
public static func equals(param: (A, A) -> Bool)(_ left: Patch, _ right: Patch) -> Bool {
return Optional.equals(Fix.equals(param))(left.state.before, right.state.before)
&& Optional.equals(Fix.equals(param))(left.state.after, right.state.after)
}
}