1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Vertex equality.

This commit is contained in:
Rob Rix 2015-09-24 18:24:05 -04:00
parent a70fc630aa
commit b76d361412

View File

@ -60,3 +60,14 @@ public func == (left: Doc, right: Doc) -> Bool {
return false
}
}
public func == <A: Equatable> (left: Vertex<A>, right: Vertex<A>) -> Bool {
switch (left, right) {
case (.End, .End):
return true
case let (.XY(a, x1, y1), .XY(b, x2, y2)):
return a == b && x1.value == y1.value && x2.value == y2.value
default:
return false
}
}