Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
sideband.c: small optimization of strbuf usage
author
Nicolas Pitre
<nico@fluxnic.net>
Tue, 5 Jul 2016 20:35:50 +0000
(16:35 -0400)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 6 Jul 2016 21:09:32 +0000
(14:09 -0700)
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sideband.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
5e5be9e
)
diff --git
a/sideband.c
b/sideband.c
index 2782df800382eb00ab7d50f1371d71bb2849d0ba..c0b6dcf703ee81b468d675c193e9b55e9b85f1ae 100644
(file)
--- a/
sideband.c
+++ b/
sideband.c
@@
-68,12
+68,12
@@
int recv_sideband(const char *me, int in_stream, int out)
int linelen = brk - b;
if (!outbuf.len)
int linelen = brk - b;
if (!outbuf.len)
- strbuf_add
f(&outbuf, "%s"
, PREFIX);
+ strbuf_add
str(&outbuf
, PREFIX);
if (linelen > 0) {
strbuf_addf(&outbuf, "%.*s%s%c",
linelen, b, suffix, *brk);
} else {
if (linelen > 0) {
strbuf_addf(&outbuf, "%.*s%s%c",
linelen, b, suffix, *brk);
} else {
- strbuf_add
f(&outbuf, "%c"
, *brk);
+ strbuf_add
ch(&outbuf
, *brk);
}
xwrite(2, outbuf.buf, outbuf.len);
strbuf_reset(&outbuf);
}
xwrite(2, outbuf.buf, outbuf.len);
strbuf_reset(&outbuf);
@@
-97,7
+97,7
@@
int recv_sideband(const char *me, int in_stream, int out)
}
if (outbuf.len) {
}
if (outbuf.len) {
- strbuf_add
f(&outbuf, "\n"
);
+ strbuf_add
ch(&outbuf, '\n'
);
xwrite(2, outbuf.buf, outbuf.len);
}
strbuf_release(&outbuf);
xwrite(2, outbuf.buf, outbuf.len);
}
strbuf_release(&outbuf);