[PATCH 4/9] vcs-svn: use constcmp instead of prefixcmp
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jul 6, 2012, 17:18 UTC
- Message-ID
- <20120706171838.GE31001@burratino>
- In-Reply-To
- <20120706171040.GA31001@burratino>
From: David Barr <davidbarr@google.com> Date: Fri, 1 Jun 2012 00:41:27 +1000
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> --- Description clarified. No other change.
vcs-svn/svndump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c index f6c0d4c8..c5d07a66 100644 --- a/vcs-svn/svndump.c +++ b/vcs-svn/svndump.c @@ -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)
-- 1.7.10.4