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

Move Vertex equality to its file.

This commit is contained in:
Rob Rix 2015-10-01 15:16:25 -04:00
parent 91e119cde7
commit 146f59bc23
2 changed files with 12 additions and 10 deletions

View File

@ -36,13 +36,3 @@ public func == (left: Doc, right: Doc) -> Bool {
}
}
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 == x2.value && y1.value == y2.value
default:
return false
}
}

View File

@ -113,3 +113,15 @@ public enum Vertex<Element>: CustomDebugStringConvertible, CustomStringConvertib
}.joinWithSeparator("\n")
}
}
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 == x2.value && y1.value == y2.value
default:
return false
}
}