diff options
author | Marcus Boerger <helly@php.net> | 2003-02-26 22:03:55 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-02-26 22:03:55 +0000 |
commit | cdcb86a4daaa4b94ca2634a010e2f726b7d48807 (patch) | |
tree | ff818a84608f622f9677f256b18c76dcebfacb30 | |
parent | 6fd9c32346b7a35dbb237c0dcd775265c384b245 (diff) | |
download | php-git-cdcb86a4daaa4b94ca2634a010e2f726b7d48807.tar.gz |
make it faster
-rw-r--r-- | ext/dba/libcdb/cdb.c | 13 |
1 files changed, 2 insertions, 11 deletions
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; } |