1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 07:55:12 +03:00

Equality of empty diffs.

This commit is contained in:
Rob Rix 2015-09-16 15:46:45 -04:00
parent d0d53d152a
commit f9023f88b7

View File

@ -31,6 +31,8 @@ public func == <F: Equatable> (left: Syntax<F>, right: Syntax<F>) -> Bool {
public func == (left: Diff, right: Diff) -> Bool { public func == (left: Diff, right: Diff) -> Bool {
switch (left, right) { switch (left, right) {
case (.Empty, .Empty):
return true
case let (.Patch(a1, b1), .Patch(a2, b2)): case let (.Patch(a1, b1), .Patch(a2, b2)):
return a1 == a2 && b1 == b2 return a1 == a2 && b1 == b2
case let (.Copy(a), .Copy(b)): case let (.Copy(a), .Copy(b)):