[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 <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Junio C Hamano 2005-05-23 00:25:15 -07:00 коммит произвёл Linus Torvalds
Родитель f7c1512af8
Коммит 046aa6440f
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -44,7 +44,8 @@ void diffcore_pickaxe(const char *needle)
if (contains(p->one, needle, len)) if (contains(p->one, needle, len))
diff_q(&outq, p); 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)) contains(p->two, needle, len))
diff_q(&outq, p); diff_q(&outq, p);
if (onum == outq.nr) if (onum == outq.nr)