mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Speedup cintcmp
Now that we know we're always 2-byte aligned...
This commit is contained in:
parent
dac3fae3b5
commit
1b69295a48
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user