vcs-svn: use constcmp instead of prefixcmp
authorDavid Barr <davidbarr@google.com>
Thu, 31 May 2012 14:41:27 +0000 (00:41 +1000)
committerJonathan Nieder <jrnieder@gmail.com>
Fri, 6 Jul 2012 04:26:52 +0000 (23:26 -0500)
Since the length of t is already known, we can simplify a little by
using memcmp() instead of strncmp() to carry out a prefix comparison.
All nearby code already does this.

Noticed in the standalone svn-dump-fast-export project which has not
needed to implement prefixcmp() yet.

Signed-off-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
vcs-svn/svndump.c
index f6c0d4c8a0524ac66abfeea31b90d80f306220e1..c5d07a66873438563967800e9f0c75aa3e7fe8e0 100644 (file)
@@ -361,7 +361,7 @@ void svndump_read(const char *url)
                        reset_rev_ctx(atoi(val));
                        break;
                case sizeof("Node-path"):
-                       if (prefixcmp(t, "Node-"))
+                       if (constcmp(t, "Node-"))
                                continue;
                        if (!constcmp(t + strlen("Node-"), "path")) {
                                if (active_ctx == NODE_CTX)