aboutsummaryrefslogtreecommitdiff
path: root/git-gui/lib
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-08-20 10:47:34 -0400
committerJunio C Hamano <gitster@pobox.com>2015-08-20 13:16:50 -0700
commitf2259877531ed2a58ec04aeaeb6beb5183f81f92 (patch)
tree94b345580485a41172af5a2dc6038ee31f36e86a /git-gui/lib
parent9f1429df179adb7a315616d01c9b237b521a3733 (diff)
downloadgit-f2259877531ed2a58ec04aeaeb6beb5183f81f92.tar.gz
git-f2259877531ed2a58ec04aeaeb6beb5183f81f92.tar.xz
format_config: simplify buffer handling
When formatting a config value into a strbuf, we may end up stringifying it into a fixed-size buffer using sprintf, and then copying that buffer into the strbuf. We can eliminate the middle-man (and drop some calls to sprintf!) by writing directly to the strbuf. The reason it was written this way in the first place is that we need to know before writing the value whether to insert a delimiter. Instead of delaying the write of the value, we speculatively write the delimiter, and roll it back in the single case that cares. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-gui/lib')
0 files changed, 0 insertions, 0 deletions