We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f35a1d7 + 0b00601 commit 822a4d4Copy full SHA for 822a4d4
1 file changed
cache.h
@@ -939,14 +939,7 @@ extern const struct object_id null_oid;
939
940
static inline int hashcmp(const unsigned char *sha1, const unsigned char *sha2)
941
{
942
- int i;
943
-
944
- for (i = 0; i < GIT_SHA1_RAWSZ; i++, sha1++, sha2++) {
945
- if (*sha1 != *sha2)
946
- return *sha1 - *sha2;
947
- }
948
949
- return 0;
+ return memcmp(sha1, sha2, GIT_SHA1_RAWSZ);
950
}
951
952
static inline int oidcmp(const struct object_id *oid1, const struct object_id *oid2)
0 commit comments