From: Marcus Boerger Date: Wed, 26 Feb 2003 22:03:55 +0000 (+0000) Subject: make it faster X-Git-Tag: RELEASE_0_5~732 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cdcb86a4daaa4b94ca2634a010e2f726b7d48807;p=php make it faster --- diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c index da3de2ff34..16aaca037a 100644 --- a/ext/dba/libcdb/cdb.c +++ b/ext/dba/libcdb/cdb.c @@ -64,23 +64,14 @@ static int cdb_match(struct cdb *c, char *key, unsigned int len, uint32 pos TSRM } /* }}} */ -/* {{{ cdb_hashadd */ -static uint32 cdb_hashadd(uint32 h, unsigned char c) -{ - h += (h << 5); - return h ^ c; -} -/* }}} */ - /* {{{ cdb_hash */ uint32 cdb_hash(char *buf, unsigned int len) { uint32 h; h = CDB_HASHSTART; - while (len) { - h = cdb_hashadd(h, *buf++); - --len; + while (len--) { + h = ( h + (h << 5)) ^ (*buf++); } return h; }