]> git.ipfire.org Git - thirdparty/git.git/commit - strbuf.c
strbuf_split_buf(): simplify iteration
authorMichael Haggerty <mhagger@alum.mit.edu>
Sun, 4 Nov 2012 06:46:52 +0000 (07:46 +0100)
committerJeff King <peff@peff.net>
Sun, 4 Nov 2012 11:46:55 +0000 (06:46 -0500)
commit1173bb331103b7e6d9e95549c7b7be12546d0697
tree20519a5aedba8ac129b00e7c35ddac50556f98ff
parentb8c2c1fa35f240ea8eee719c0f5a657285864573
strbuf_split_buf(): simplify iteration

While iterating, update str and slen to keep track of the part of the
string that hasn't been processed yet rather than computing things
relative to the start of the original string.  This eliminates one
local variable, reduces the scope of another, and reduces the amount
of arithmetic needed within the loop.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
strbuf.c