[PATCH] Performance fix for pickaxe.
authorJunio C Hamano <junkio@cox.net>
Mon, 23 May 2005 07:25:15 +0000 (00:25 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 23 May 2005 18:49:30 +0000 (11:49 -0700)
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 <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
diffcore-pickaxe.c

index be1bbcc..fea62d5 100644 (file)
@@ -44,7 +44,8 @@ void diffcore_pickaxe(const char *needle)
                        if (contains(p->one, needle, len))
                                diff_q(&outq, p);
                }
-               else if (contains(p->one, needle, len) !=
+               else if (!diff_unmodified_pair(p) &&
+                        contains(p->one, needle, len) !=
                         contains(p->two, needle, len))
                        diff_q(&outq, p);
                if (onum == outq.nr)