Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2021-10-01 04:37:55 +0300
committerJunio C Hamano <gitster@pobox.com>2021-10-01 04:48:51 +0300
commit8e2af8f0db329a8c0211a309fa9cb611b6dc2517 (patch)
tree3a68d28d2a36f78af554d4f1949e4e96df7bf991 /builtin/difftool.c
parent2255c80c91da9ed7fa127dad3aa92eb9f448c88b (diff)
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 <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/difftool.c')
-rw-r--r--builtin/difftool.c2
1 files changed, 0 insertions, 2 deletions
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);