From: David Aguilar Date: Fri, 1 Oct 2021 01:37:55 +0000 (-0700) Subject: difftool: remove an unnecessary call to strbuf_release() X-Git-Tag: v2.34.0-rc0~71^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e2af8f0db329a8c0211a309fa9cb611b6dc2517;p=thirdparty%2Fgit.git difftool: remove an unnecessary call to strbuf_release() The `buf` strbuf is reused again later in the same function, so there is no benefit to calling strbuf_release(). The subsequent usage is already using strbuf_reset() to reset the buffer, so releasing it early is only going to lead to a wasteful reallocation. Remove the early call to strbuf_release(). The same strbuf is already cleaned up in the "finish:" section so nothing is leaked, either. Signed-off-by: David Aguilar Signed-off-by: Junio C Hamano --- diff --git a/builtin/difftool.c b/builtin/difftool.c index be7ed2acaa..1a415a15a3 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -568,8 +568,6 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix, write_standin_files(entry, &ldir, ldir_len, &rdir, rdir_len); } - strbuf_release(&buf); - strbuf_setlen(&ldir, ldir_len); helper_argv[1] = ldir.buf; strbuf_setlen(&rdir, rdir_len);