-static void **hashvector_find_slot(hashvector *hv,void *key) {
- unsigned long index = hv->keyhashcode( key ) % hv->table.size;
- unsigned long i = index;
+// If itemkey is set, then the itemkey callback function is used for
+// obtaining a temporary key from the item.
+static void **hashvector_find_slot(
+ hashvector *hv, void *key, unsigned long *i, int itemkey )
+{
+ if ( itemkey ) {
+ // Get actual key from keying item
+ key = hv->type->itemkey( SELF, key );
+ }
+ unsigned long index = hv->type->hashcode( SELF, key ) % hv->table.size;
+ *i = index;