From a0aa0221243ab4637f56489106afaf35b8b0085f Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 14 Sep 2003 16:41:11 +0000 Subject: [PATCH] Explain the optimization. --- report.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/report.c b/report.c index 9d2a045..98feb91 100644 --- a/report.c +++ b/report.c @@ -139,6 +139,12 @@ static int collapse_ranges(struct match_t *reduced, int nonuniques) { int remaining; + /* + * This optimization drastically reduces the number of compare_files + * calls. The continue condition in the inner loop below would + * otherwise involve one every time for O(n**2) calls; this reduces + * the number to O(n). + */ if (spancount <= 0) { spancount = 0; -- 2.43.0