From 7b96d5699620848ac7fdc7c88b65405c0540e893 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 18 Jul 2017 17:53:30 +0200 Subject: [PATCH] Use the provided equal functor for prefix/suffix detection in diff We were wrongly using the `==` operator. --- src/diff.hh | 4 ++-- 1 file 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& 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});