]> git.ipfire.org Git - thirdparty/git.git/commitdiff
vcs-svn: use strchr to find RFC822 delimiter
authorDavid Barr <david.barr@cordelta.com>
Tue, 14 Dec 2010 00:06:43 +0000 (11:06 +1100)
committerJonathan Nieder <jrnieder@gmail.com>
Tue, 22 Mar 2011 23:09:05 +0000 (18:09 -0500)
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>
vcs-svn/svndump.c

index 77680a31e8fed797715bc7c6727082574951ad0c..0919a576dc7dd0a129dbc0f9bb49547edb8e9fe8 100644 (file)
@@ -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) {