Git fork

trace2: trim_trailing_newline followed by trim is a no-op

strbuf_trim_trailing_newline() removes a LF or a CRLF from the tail
of a string. If the code plans to call strbuf_trim() immediately
after doing so, the code is better off skipping the EOL trimming in
the first place. After all, LF/CRLF at the end is a mere special
case of whitespaces at the end of the string, which will be removed
by strbuf_rtrim() anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

-2
-2
trace2/tr2_cfg.c
··· 39 39 40 40 if (buf->len && buf->buf[buf->len - 1] == ',') 41 41 strbuf_setlen(buf, buf->len - 1); 42 - strbuf_trim_trailing_newline(*s); 43 42 strbuf_trim(*s); 44 43 } 45 44 ··· 78 77 79 78 if (buf->len && buf->buf[buf->len - 1] == ',') 80 79 strbuf_setlen(buf, buf->len - 1); 81 - strbuf_trim_trailing_newline(*s); 82 80 strbuf_trim(*s); 83 81 } 84 82