From b76d361412de746ee785fa82073c0d930d4568c6 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 24 Sep 2015 18:24:05 -0400 Subject: [PATCH] Vertex equality. --- prototype/Doubt/Equatable.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/prototype/Doubt/Equatable.swift b/prototype/Doubt/Equatable.swift index 34cfd49e7..e134da62d 100644 --- a/prototype/Doubt/Equatable.swift +++ b/prototype/Doubt/Equatable.swift @@ -60,3 +60,14 @@ public func == (left: Doc, right: Doc) -> Bool { return false } } + +public func == (left: Vertex, right: Vertex) -> 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 + } +}