Skip to content

Commit ca9b37e

Browse files
stefanbellergitster
authored andcommitted
diff: remove dead code
When `len < 1`, len has to be 0 or negative, emit_line will then remove the first character and by then `len` would be negative. As this doesn't happen, it is safe to assume it is dead code. This continues to simplify the code, which was started in b8d9c1a (2009-09-03, diff.c: the builtin_diff() deals with only two-file comparison). Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ba16233 commit ca9b37e

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

diff.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,14 +1252,6 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
12521252
return;
12531253
}
12541254

1255-
if (len < 1) {
1256-
emit_line(o, reset, reset, line, len);
1257-
if (ecbdata->diff_words
1258-
&& ecbdata->diff_words->type == DIFF_WORDS_PORCELAIN)
1259-
fputs("~\n", o->file);
1260-
return;
1261-
}
1262-
12631255
if (ecbdata->diff_words) {
12641256
if (line[0] == '-') {
12651257
diff_words_append(line, len,

0 commit comments

Comments
 (0)