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:

committed by
Junio C Hamano

parent
017ac45e87
commit
29ef759d7c
@ -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>
|
||||
|
Reference in New Issue
Block a user