From: Eric S. Raymond Date: Sun, 14 Sep 2003 16:56:54 +0000 (+0000) Subject: Try some more microtweaking. X-Git-Tag: 1.6~21 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=f5471dd67495d09499b89c623830bbe8181bc13c;p=comparator.git Try some more microtweaking. --- diff --git a/report.c b/report.c index 98feb91..70172a7 100644 --- a/report.c +++ b/report.c @@ -23,14 +23,12 @@ static int merge_ranges(struct sorthash_t *p, /* merge p into q, if the ranges in the match are compatible */ { int i, mc, overlap; + /* * The general problem: you have two lists of shreds, of the same * lengths. Within each list, all shreds have the same hash. * Within the lists, the shreds are sorted in filename order. * - */ - - /* * There are two possible overlap cases. Either the start line of * each range in p is within the corresponding range in q or * vice-versa. If we know all pairs of shreds intersect, we @@ -42,12 +40,16 @@ static int merge_ranges(struct sorthash_t *p, for (i = 0; i < nmatches; i++) if (p[i].hash.start >= q[i].hash.start && p[i].hash.start <= q[i].hash.end) mc++; + else + break; if (mc == nmatches) overlap = 1; mc = 0; for (i = 0; i < nmatches; i++) if (q[i].hash.start >= p[i].hash.start && q[i].hash.start <= p[i].hash.end) mc++; + else + break; if (mc == nmatches) overlap = 1; if (!overlap)