提交 ca9b37e5 编写于 作者: S Stefan Beller 提交者: Junio C Hamano

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 b8d9c1a6
(2009-09-03,  diff.c: the builtin_diff() deals with only two-file
comparison).
Signed-off-by: NStefan Beller <sbeller@google.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 ba16233c
......@@ -1252,14 +1252,6 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
return;
}
if (len < 1) {
emit_line(o, reset, reset, line, len);
if (ecbdata->diff_words
&& ecbdata->diff_words->type == DIFF_WORDS_PORCELAIN)
fputs("~\n", o->file);
return;
}
if (ecbdata->diff_words) {
if (line[0] == '-') {
diff_words_append(line, len,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册