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

Re: [PATCH 4/9] vcs-svn: implement perfect hash for top-level keys

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:50:49

David Barr wrote:
quoted hunk ↗ jump to hunk
--- a/vcs-svn/svndump.c
+++ b/vcs-svn/svndump.c
@@ -323,16 +296,25 @@ void svndump_read(const char *url)
 			continue;
 		*val++ = '\0';
 		*val++ = '\0';
-		key = pool_intern(t);
 
-		if (key == keys.svn_fs_dump_format_version) {
+		/* strlen(key) */
+		switch (val - t - 2) { 
+		case 26:
+			if (memcmp(t, "SVN-fs-dump-format-version", 26))
+				continue;
Same comments as the previous patch apply here.

Might make sense to split out the loop body (or at least the giant
switch statement) as a separate function for easier contemplation.

[...]
-		} else if (key == keys.content_length) {
+			break;
+		case 14:
+			if (memcmp(t, "Content-length", 14))
+				continue;
 			len = atoi(val);
Thanks for a very clean patch.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help