]> git.ipfire.org Git - thirdparty/git.git/commit
ls-tree: remove dead store and strbuf for quote_c_style()
authorRené Scharfe <l.s.r@web.de>
Sat, 14 Jan 2023 15:03:16 +0000 (16:03 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 15 Jan 2023 03:22:26 +0000 (19:22 -0800)
commitc388fcda9943c0cf46960787041a1ff3bcf5e833
treef7eb4243e00f96a1f353961d9a9121b4b0d325cd
parent16fb5c54bd91c9714e12c6d742e5a6fd81459b71
ls-tree: remove dead store and strbuf for quote_c_style()

Stop initializing "name" because it is set again before use.

Let quote_c_style() write directly to "sb" instead of taking a detour
through "quoted".  This avoids an allocation and a string copy.  The
result is the same because the function only appends.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/ls-tree.c