]> thyrsus.com Git - comparator.git/commitdiff
Try some more microtweaking.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 14 Sep 2003 16:56:54 +0000 (16:56 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 14 Sep 2003 16:56:54 +0000 (16:56 +0000)
report.c

index 98feb917f91b3c082392474691e6f1b02ed8704d..70172a7b5c70b7ddb1db46f4461610f123f48260 100644 (file)
--- 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)