diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2012-07-18 01:56:52 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2012-07-18 01:56:52 +0000 |
commit | 20c4839edb394def43c07646d87d0cdbabefffa6 (patch) | |
tree | 1520e68a422dd8cbb0ddb6af06649e52d5eff8fe /lib | |
parent | bcb9e4803365f4a670bcb73d48efed51c488006b (diff) | |
download | netpbm-mirror-20c4839edb394def43c07646d87d0cdbabefffa6.tar.gz netpbm-mirror-20c4839edb394def43c07646d87d0cdbabefffa6.tar.xz netpbm-mirror-20c4839edb394def43c07646d87d0cdbabefffa6.zip |
performance improvement: new hash function
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1719 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libpammap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libpammap.c b/lib/libpammap.c index 8477875a..fe6cba2d 100644 --- a/lib/libpammap.c +++ b/lib/libpammap.c @@ -31,9 +31,10 @@ pnm_hashtuple(struct pam * const pamP, Return the hash value of the tuple 'tuple' -- i.e. an index into a hash table. -----------------------------------------------------------------------------*/ + unsigned int const hash_factor[] = {1, 33, 33*33}; + unsigned int i; unsigned int hash; - const unsigned int hash_factor[] = {33*33, 33, 1}; hash = 0; /* initial value */ for (i = 0; i < MIN(pamP->depth, 3); ++i) { |