summaryrefslogtreecommitdiff
path: root/src/diff.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-07-18 17:53:30 +0200
committerMaxime Coste <mawww@kakoune.org>2017-07-18 17:53:30 +0200
commit7b96d5699620848ac7fdc7c88b65405c0540e893 (patch)
tree4d6d82b3480d387bfc46dbe8594b52a3cb09ef85 /src/diff.hh
parentbed8d9c48eb8e1955b15fba875d1bbda3e041b31 (diff)
Use the provided equal functor for prefix/suffix detection in diff
We were wrongly using the `==` operator.
Diffstat (limited to 'src/diff.hh')
-rw-r--r--src/diff.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/diff.hh b/src/diff.hh
index e1274c48..178eed18 100644
--- a/src/diff.hh
+++ b/src/diff.hh
@@ -113,11 +113,11 @@ void find_diff_rec(Iterator a, int begA, int endA,
int* V1, int* V2, Equal eq, Vector<Diff>& diffs)
{
int prefix_len = 0;
- while (begA != endA and begB != endB and a[begA] == b[begB])
+ while (begA != endA and begB != endB and eq(a[begA], b[begB]))
++begA, ++begB, ++prefix_len;
int suffix_len = 0;
- while (begA != endA and begB != endB and a[endA-1] == b[endB-1])
+ while (begA != endA and begB != endB and eq(a[endA-1], b[endB-1]))
--endA, --endB, ++suffix_len;
append_diff(diffs, {Diff::Keep, prefix_len, 0});