Skip to contentSkip to conversation

Performance fix for pickaxe.

PATCH New Junio C Hamano 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

diffcore-pickaxe.c | 3 ++-

1 files changed, 2 insertions(+), 1 deletion(-)
diffcore-pickaxe.c +2 -1
@@ -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)

------------------------------------------------