mirror of
https://github.com/github/semantic.git
synced 2024-12-01 17:59:10 +03:00
Patches have different costs.
This commit is contained in:
parent
4fdbcf948f
commit
d7db7415dc
@ -11,7 +11,7 @@ public func SES<A>(a: [Fix<A>], _ b: [Fix<A>], equals: (A, A) -> Bool, recur: (F
|
||||
if b.isEmpty { return a.map { Diff.Pure(Patch.Delete($0)) } }
|
||||
|
||||
func cost(diff: Diff) -> Int {
|
||||
return diff.map(const(1)).iterate { syntax in
|
||||
return diff.map { $0.cost }.iterate { syntax in
|
||||
switch syntax {
|
||||
case .Leaf:
|
||||
return 0
|
||||
|
Loading…
Reference in New Issue
Block a user