diff --git a/prototype/doubt-difftool/main.swift b/prototype/doubt-difftool/main.swift index 893190e08..7cec7f15b 100644 --- a/prototype/doubt-difftool/main.swift +++ b/prototype/doubt-difftool/main.swift @@ -154,8 +154,8 @@ extension ForwardIndexType { func refineLeafReplacement(aString: String, _ bString: String)(_ patch: Patch) -> Diff { switch patch { case let .Replace(.Unroll(aExtract, .Leaf), .Unroll(bExtract, .Leaf)): - let a = aString.utf16[aExtract.range].enumerate().map { Term(Info(range: (aExtract.range.startIndex + 0).range, categories: aExtract.categories), .Leaf(String($1))) } - let b = bString.utf16[bExtract.range].enumerate().map { Term(Info(range: (bExtract.range.startIndex + 0).range, categories: bExtract.categories), .Leaf(String($1))) } + let a = aString.utf16[aExtract.range].enumerate().map { Term(Info(range: (aExtract.range.startIndex + $0).range, categories: aExtract.categories), .Leaf(String($1))) } + let b = bString.utf16[bExtract.range].enumerate().map { Term(Info(range: (bExtract.range.startIndex + $0).range, categories: bExtract.categories), .Leaf(String($1))) } return .Roll((aExtract, bExtract), .Indexed(SES(a, b, cost: const(1), recur: { $0 == $1 ? Term.zip($0, $1).map(Diff.init) : Diff.Replace($0, $1) }))) default: return .Pure(patch)