Skip to content

Commit 8e2af8f

Browse files
davvidgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2255c80 commit 8e2af8f

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

builtin/difftool.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,6 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
568568
write_standin_files(entry, &ldir, ldir_len, &rdir, rdir_len);
569569
}
570570

571-
strbuf_release(&buf);
572-
573571
strbuf_setlen(&ldir, ldir_len);
574572
helper_argv[1] = ldir.buf;
575573
strbuf_setlen(&rdir, rdir_len);

0 commit comments

Comments
 (0)