From be99ec97c8a1f94e723c6cc5331eff921ae49ed3 Mon Sep 17 00:00:00 2001 From: Jeremiah Mahler Date: Thu, 19 Jun 2014 19:06:43 -0700 Subject: name-hash.c: replace cache_name_compare() with memcmp(3) The same_name() private function wants a quick-and-exact check to see if they two names are byte-for-byte identical first and then fall back to the slow path. Use memcmp(3) for the former to make it clear that we do not want any "name" specific comparison. Signed-off-by: Jeremiah Mahler Signed-off-by: Junio C Hamano --- name-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'name-hash.c') diff --git a/name-hash.c b/name-hash.c index 97444d020..49fd50831 100644 --- a/name-hash.c +++ b/name-hash.c @@ -179,7 +179,7 @@ static int same_name(const struct cache_entry *ce, const char *name, int namelen * Always do exact compare, even if we want a case-ignoring comparison; * we do the quick exact one first, because it will be the common case. */ - if (len == namelen && !cache_name_compare(name, namelen, ce->name, len)) + if (len == namelen && !memcmp(name, ce->name, len)) return 1; if (!icase) -- cgit v1.2.1