From: Howard Chu Date: Thu, 8 Sep 2011 20:10:17 +0000 (-0700) Subject: Speedup cintcmp X-Git-Tag: OPENLDAP_REL_ENG_2_4_27~148^2~49 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1b69295a48cca409ed0c2f3fe655325e00f55ce2;p=openldap Speedup cintcmp Now that we know we're always 2-byte aligned... --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index f165288573..0d854b1919 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -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);