aboutsummaryrefslogtreecommitdiffhomepage
path: root/util.h
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2007-01-17 02:37:07 +1000
committerGravatar axel <axel@liljencrantz.se>2007-01-17 02:37:07 +1000
commit54e19b1efbc3a959f4d5207bc9faeab2f4b25aab (patch)
treee5d7e4bdb2dcfe9302855a691bb5ba037aa3ab2e /util.h
parentf603b6ef68696be0f90a5fe6c834665d6e2670bb (diff)
Add a one-item cache into the hash table. This reduces the number of hash computations by roughly 20%
darcs-hash:20070116163707-ac50b-214a16d4210d32fb50693e71a14b6b8f3fededfe.gz
Diffstat (limited to 'util.h')
-rw-r--r--util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/util.h b/util.h
index c5590c4a..a84378e0 100644
--- a/util.h
+++ b/util.h
@@ -73,6 +73,8 @@ typedef struct hash_table
{
/** The array containing the data */
hash_struct_t *arr;
+ /** A simple one item cache. This should always point to the index of the last item to be used */
+ int cache;
/** Number of elements */
int count;
/** Length of array */