diff: use emit_line_0 once per line

All lines that use emit_line_0 multiple times per line, are combined
into a single call to emit_line_0, making use of the 'set' argument.

We gain a little efficiency here, as we can omit emission of color and
accompanying reset if 'len == 0'.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stefan Beller
2018-08-13 18:41:20 -07:00
committed by Junio C Hamano
parent 017ac45e87
commit 29ef759d7c
2 changed files with 9 additions and 9 deletions

View File

@ -151,7 +151,7 @@ test_expect_success 'dual-coloring' '
: s/4/A/<RESET>
: <RESET>
: <REVERSE><GREEN>+<RESET><BOLD> Also a silly comment here!<RESET>
: <REVERSE><GREEN>+<RESET><BOLD><RESET>
: <REVERSE><GREEN>+<RESET>
: diff --git a/file b/file<RESET>
: <RED> --- a/file<RESET>
: <GREEN> +++ b/file<RESET>