From 085eb4b82d7def6bcff4c127b318151da254131f Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 12 Sep 2003 10:01:53 +0000 Subject: [PATCH] Reduction was broken. --- report.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/report.c b/report.c index b4307a2..4d12c5e 100644 --- a/report.c +++ b/report.c @@ -189,16 +189,19 @@ struct match_t *reduce_matches(struct sorthash_t *obarray, int *hashcountp) * * The technique: first mark... */ - if (!HASHCMP(obarray, obarray+1)) + if (HASHCMP(obarray, obarray+1)) obarray[0].hash.start = UNIQUE_FLAG; for (np = obarray+1; np < obarray + hashcount-1; np++) - if (!HASHCMP(np, np-1) && !HASHCMP(np, np+1)) + if (HASHCMP(np, np-1) && HASHCMP(np, np+1)) np->hash.start = UNIQUE_FLAG; - if (!HASHCMP(obarray+hashcount-2, obarray+hashcount-1)) + if (HASHCMP(obarray+hashcount-2, obarray+hashcount-1)) obarray[hashcount-1].hash.start = UNIQUE_FLAG; + for (np = obarray; np < obarray + hashcount; np++) + printf("%d ", np->hash.start); + putchar('\n'); /* ...then sweep. */ for (mp = np = obarray; np < obarray + hashcount; np++) - if (np->hash.start != UNIQUE_FLAG && mp < np) + if (np->hash.start != UNIQUE_FLAG) *mp++ = *np; /* now we get to reduce the memory footprint */ report_time("Compaction reduced %d shreds to %d", -- 2.43.0