Skip to content

Commit

Permalink
vcs-svn: use strchr to find RFC822 delimiter
Browse files Browse the repository at this point in the history
This is a small optimisation (4% reduction in user time) but is the
largest artifact within the parsing portion of svndump.c

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
  • Loading branch information
David Barr authored and Jonathan Nieder committed Mar 22, 2011
1 parent 90c0a3c commit f160205
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vcs-svn/svndump.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,13 @@ void svndump_read(const char *url)

reset_dump_ctx(pool_intern(url));
while ((t = buffer_read_line(&input))) {
val = strstr(t, ": ");
val = strchr(t, ':');
if (!val)
continue;
val += 2;
val++;
if (*val != ' ')
continue;
val++;

/* strlen(key) + 1 */
switch (val - t - 1) {
Expand Down

0 comments on commit f160205

Please sign in to comment.