Thread (67 messages) flat view 67 messages, 5 authors, 2016-06-15
STALE3729d

[PATCH 9/9] vcs-svn: use strchr to find RFC822 delimiter

From: David Barr <hidden>
Date: 2016-06-15 22:50:48
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: David Barr <redacted>
---
 vcs-svn/svndump.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c
index fd67db8..7bc2d3d 100644
--- a/vcs-svn/svndump.c
+++ b/vcs-svn/svndump.c
@@ -296,10 +296,12 @@ void svndump_read(const char *url)
 
 	reset_dump_ctx(url);
 	while ((t = buffer_read_line(&input))) {
-		val = strstr(t, ": ");
+		val = strchr(t, ':');
 		if (!val)
 			continue;
 		*val++ = '\0';
+		if (*val != ' ')
+			continue;
 		*val++ = '\0';
 
 		/* strlen(key) */
-- 
1.7.3.2.846.gf4b062
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help