From bd0877e63eb4016dc95c078c5e910481ee5e4089 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 13 Sep 2003 22:20:57 +0000 Subject: [PATCH] Serious speedup by collapsing the search loop. --- report.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/report.c b/report.c index e211c61..56a45b8 100644 --- a/report.c +++ b/report.c @@ -106,7 +106,7 @@ static int collapse_ranges(struct match_t *reduced, int nonuniques) int removed = 0; /* - * For two matches to be eligible for merger, all the filenames + * For two matches to be eligible for merger, all their filenames must * match pairwise. If there are no such matches, these chunks are * completely irrelevant to each other. It might be that for some * values of i the filenames are equal and for others not. In @@ -135,7 +135,7 @@ static int collapse_ranges(struct match_t *reduced, int nonuniques) /* time to merge overlapping shreds */ for (sp = reduced; sp < reduced + nonuniques; sp++) - for (tp = sp + 1; tp < reduced + nonuniques; tp++) + for (tp = sp + 1; !compare_files(sp, tp); tp++) { #ifdef DEBUG printf("Trying merge of %d into %d\n", tp-reduced, sp-reduced); -- 2.43.0