mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
Vertex equality.
This commit is contained in:
parent
a70fc630aa
commit
b76d361412
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user