Re: [PATCH] use strbuf_addbuf() for appending a strbuf to another

2016-07-22 Thread Junio C Hamano
Jeff King writes: > I don't think we do. Going back to the original discussion: > > http://thread.gmane.org/gmane.comp.version-control.git/136141/focus=136774 > > it was mostly just "hey, this would fail really confusingly if we ever > did, so let's make it safe". > > The second

Re: [PATCH] use strbuf_addbuf() for appending a strbuf to another

2016-07-21 Thread Jeff King
On Thu, Jul 21, 2016 at 06:46:44PM +0200, René Scharfe wrote: > >> - strbuf_add(out, untracked->ident.buf, untracked->ident.len); > >> + strbuf_addbuf(out, >ident); > > > > This is actually slightly _less_ efficient, because we already are using > > the precomputed len, and the new code will

Re: [PATCH] use strbuf_addbuf() for appending a strbuf to another

2016-07-21 Thread René Scharfe
Am 20.07.2016 um 15:20 schrieb Jeff King: > On Tue, Jul 19, 2016 at 08:36:29PM +0200, René Scharfe wrote: > >> Use strbuf_addbuf() where possible; it's shorter and more efficient. > > After seeing "efficient", I was momentarily surprised by the first hunk: > >> diff --git a/dir.c b/dir.c >>

Re: [PATCH] use strbuf_addbuf() for appending a strbuf to another

2016-07-20 Thread Jeff King
On Tue, Jul 19, 2016 at 08:36:29PM +0200, René Scharfe wrote: > Use strbuf_addbuf() where possible; it's shorter and more efficient. After seeing "efficient", I was momentarily surprised by the first hunk: > diff --git a/dir.c b/dir.c > index 6172b34..0ea235f 100644 > --- a/dir.c > +++ b/dir.c

[PATCH] use strbuf_addbuf() for appending a strbuf to another

2016-07-19 Thread René Scharfe
Use strbuf_addbuf() where possible; it's shorter and more efficient. Signed-off-by: Rene Scharfe --- dir.c | 2 +- path.c | 2 +- wt-status.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dir.c b/dir.c index 6172b34..0ea235f 100644 --- a/dir.c