]> thyrsus.com Git - comparator.git/commitdiff
Set up to remove duplicates.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 1 Sep 2003 16:48:31 +0000 (16:48 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 1 Sep 2003 16:48:31 +0000 (16:48 +0000)
report.c

index ca16650e401169399f4d6d5768ab27badcc56002..69c31e09bd00a0fcb095da1d7bedf7c7482afdbb 100644 (file)
--- a/report.c
+++ b/report.c
@@ -222,6 +222,7 @@ struct match_t *reduce_matches(int localdups)
      static struct match_t dummy; 
      struct match_t *reduced = &dummy;
 
+     /* build list of hashes with more than one range associated with */
      for (np = obarray; np < obarray + hashcount; np++)
      {
         if (np < obarray + hashcount - 1 && !HASHCMP(np, np+1))
@@ -249,8 +250,10 @@ struct match_t *reduce_matches(int localdups)
             np = mp-1;
        }
      }
-
      free(obarray);
+
+     /* time to remove duplicates */
+
      return reduced;
 }
 
@@ -306,8 +309,7 @@ main(int argc, char *argv[])
        {
            struct range_t      *rp = reduced->matches+i;
 
-           printf("%s:%d:%d\n", 
-                  rp->file, rp->start, rp->end);
+           printf("%s:%d:%d\n",  rp->file, rp->start, rp->end);
        }
        printf("-\n");
     }