Code

n is in fact unused, and is later shadowed.
[git.git] / convert-objects.c
index ebea8e472bb2eede02219999b0cfd9a63f211d4b..4e7ff7517f40f5dd5c23cd3fd6a42d3cb621aec1 100644 (file)
@@ -1,5 +1,6 @@
 #define _XOPEN_SOURCE 500 /* glibc2 and AIX 5.3L need this */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
+#define _GNU_SOURCE
 #include <time.h>
 #include "cache.h"
 #include "blob.h"
@@ -38,7 +39,7 @@ static struct entry *lookup_entry(unsigned char *sha1)
        while (low < high) {
                int next = (low + high) / 2;
                struct entry *n = convert[next];
-               int cmp = memcmp(sha1, n->old_sha1, 20);
+               int cmp = hashcmp(sha1, n->old_sha1);
                if (!cmp)
                        return n;
                if (cmp < 0) {