Skip to content

Commit 046aa64

Browse files
Junio C HamanoLinus Torvalds
authored andcommitted
[PATCH] Performance fix for pickaxe.
The pickaxe was expanding the blobs and searching in them even when it should have already known that both sides are the same. Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f7c1512 commit 046aa64

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

diffcore-pickaxe.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ void diffcore_pickaxe(const char *needle)
4444
if (contains(p->one, needle, len))
4545
diff_q(&outq, p);
4646
}
47-
else if (contains(p->one, needle, len) !=
47+
else if (!diff_unmodified_pair(p) &&
48+
contains(p->one, needle, len) !=
4849
contains(p->two, needle, len))
4950
diff_q(&outq, p);
5051
if (onum == outq.nr)

0 commit comments

Comments
 (0)