mirror of
https://github.com/github/semantic.git
synced 2024-12-01 17:59:10 +03:00
Short-circuit for equal terms.
This commit is contained in:
parent
7d36421d6a
commit
dfbfb9fe79
@ -46,6 +46,10 @@ public enum Diff: Comparable, CustomDebugStringConvertible, CustomDocConvertible
|
||||
}
|
||||
|
||||
public init(_ a: Term, _ b: Term) {
|
||||
if a == b {
|
||||
self = Diff(b)
|
||||
return
|
||||
}
|
||||
switch (a.syntax, b.syntax) {
|
||||
case (.Empty, .Empty):
|
||||
self = .Copy(.Empty)
|
||||
|
Loading…
Reference in New Issue
Block a user