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:
parent
91e119cde7
commit
146f59bc23
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user