Skip to content
Commit 355ef8e1 authored by David Howells's avatar David Howells
Browse files

keys: Cache the hash value to avoid lots of recalculation



Cache the hash of the key's type and description in the index key so that
we're not recalculating it every time we look at a key during a search.
The hash function does a bunch of multiplications, so evading those is
probably worthwhile - especially as this is done for every key examined
during a search.

This also allows the methods used by assoc_array to get chunks of index-key
to be simplified.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent f771fde8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment