vcs-svn: use strchr to find RFC822 delimiter
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>
David Barr committed
Dec 14, 2010 at 11:06 UTC
f1602054e3a45e195edf814681e8f5ba88851623
1 file changed
+5
-2
vcs-svn/svndump.c
+5
-2
@@ -297,10 +297,13 @@ void svndump_read(const char *url)
297
298
reset_dump_ctx(pool_intern(url));
299
while ((t = buffer_read_line(&input))) {
300
- val = strstr(t, ": ");
300
+ val = strchr(t, ':');
301
if (!val)
302
continue;
303
- val += 2;
303
+ val++;
304
+ if (*val != ' ')
305
+ continue;
306
+ val++;
307
308
/* strlen(key) + 1 */
309
switch (val - t - 1) {