From 75450307c0c5a0fdf9826e5b06bdf252cfe22df0 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 6 Sep 2026 20:14:48 -1000 Subject: Trim the comments and dead code across the tree --- source/ui-ssdiff.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'source/ui-ssdiff.c') diff --git a/source/ui-ssdiff.c b/source/ui-ssdiff.c index 8651ce7..759a77b 100644 --- a/source/ui-ssdiff.c +++ b/source/ui-ssdiff.c @@ -33,8 +33,7 @@ static struct deferred_line *deferred_new, *deferred_new_last; /* * The table is reused by every comparison and nothing clears it in between, * because the fill in longest_common_subsequence works back from the far - * corner and writes every cell it goes on to read. Clearing it for each pair - * of lines cost more than the comparison it was preparing for. + * corner and writes every cell it goes on to read. */ static void create_lcs_table(void) { @@ -107,9 +106,8 @@ static char *longest_common_subsequence(const char *old_line, } /* - * The line with its tabs expanded, which the caller owns. Appending as the - * line is walked replaces a loop that rescanned the rest of the input at every - * tab, which made a tab heavy line quadratic in its own length. + * The line with its tabs expanded, which the caller owns. Built in one + * forward pass so a tab heavy line stays linear in its own length. */ static char *expand_tabs(const char *line) { @@ -135,9 +133,8 @@ static void flush_run(struct strbuf *run) } /* - * A stretch that the other side does not share is escaped in one call because - * escaping a character at a time sent every character of every changed line - * through the output path on its own, which dominated this page. + * A stretch the other side does not share is escaped in one call, so a + * changed line does not go through the output path a byte at a time. */ static void print_line_with_lcs(const char *class, const char *line, const char *lcs) @@ -397,8 +394,7 @@ void cgit_ssdiff_line_cb(char *line, int len) } if (line[0] == ' ') { - if (deferred_old || deferred_new) - print_deferred_lines(); + print_deferred_lines(); print_row("ctx", current_old_line, line, current_new_line, line, 0); current_old_line += 1; @@ -438,7 +434,6 @@ void cgit_ssdiff_header_end(void) void cgit_ssdiff_footer(void) { - if (deferred_old || deferred_new) - print_deferred_lines(); + print_deferred_lines(); html("\n"); } -- cgit v2.8.0