Skip to content

Commit be99ec9

Browse files
jmahlergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cb682f8 commit be99ec9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

name-hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static int same_name(const struct cache_entry *ce, const char *name, int namelen
179179
* Always do exact compare, even if we want a case-ignoring comparison;
180180
* we do the quick exact one first, because it will be the common case.
181181
*/
182-
if (len == namelen && !cache_name_compare(name, namelen, ce->name, len))
182+
if (len == namelen && !memcmp(name, ce->name, len))
183183
return 1;
184184

185185
if (!icase)

0 commit comments

Comments
 (0)