]> git.sur5r.net Git - openldap/commitdiff
Speedup cintcmp
authorHoward Chu <hyc@symas.com>
Thu, 8 Sep 2011 20:10:17 +0000 (13:10 -0700)
committerHoward Chu <hyc@symas.com>
Thu, 8 Sep 2011 20:10:17 +0000 (13:10 -0700)
Now that we know we're always 2-byte aligned...

libraries/libmdb/mdb.c

index f16528857348521a493d8683f012dcb1ab33bedb..0d854b1919ab99a8495faa42372d5d51f7caef96 100644 (file)
@@ -1912,14 +1912,14 @@ static int
 cintcmp(const MDB_val *a, const MDB_val *b)
 {
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-       unsigned char *u, *c;
+       unsigned short *u, *c;
        int x;
 
        u = a->mv_data + a->mv_size;
        c = b->mv_data + a->mv_size;
        do {
                x = *--u - *--c;
-       } while(!x && u > (unsigned char *)a->mv_data);
+       } while(!x && u > (unsigned short *)a->mv_data);
        return x;
 #else
        return memcmp(a->mv_data, b->mv_data, a->mv_size);