New strbuf APIs: splice and attach.
* strbuf_splice replace a portion of the buffer with another. * strbuf_attach replace a strbuf buffer with the given one, that should be malloc'ed. Then it enforces strbuf's invariants. If alloc > len, then this function has negligible cost, else it will perform a realloc, possibly with a cost. Also some style issues are fixed now. Signed-off-by: NPierre Habouzit <madcoder@debian.org> Acked-by: NLinus Torvalds <torvalds@linux-foundation.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
Showing
想要评论请 注册 或 登录