On Sun, Apr 05, 2015 at 10:13:21PM -0400, Eric Sunshine wrote:
- strbuf_grow(sb, 1);
+ strbuf_grow_ch(sb);
strbuf_grow_ch() seems overly special-case. What about instead taking
advantage of inline strbuf_avail() to do something like this?
if
On Sat, Apr 4, 2015 at 9:11 PM, Jeff King p...@peff.net wrote:
We have to call strbuf_grow anytime we are going to add data
to a strbuf. In most cases, it's a noop (since we grow the
buffer aggressively), and the cost of the function call and
size check is dwarfed by the actual buffer
We have to call strbuf_grow anytime we are going to add data
to a strbuf. In most cases, it's a noop (since we grow the
buffer aggressively), and the cost of the function call and
size check is dwarfed by the actual buffer operation.
For a tight loop of single-character additions, though, this
3 matches
Mail list logo