More tweaking of the new hashtab module
git-svn-id: svn://svn.cc65.org/cc65/trunk@2560 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -96,7 +96,7 @@ HashNode* HT_Find (const HashTable* T, const void* Key)
|
||||
* if it is not really necessary.
|
||||
*/
|
||||
if (N->Hash == Hash &&
|
||||
T->Func->Compare (Key, T->Func->GetIndex (N->Entry))) {
|
||||
T->Func->Compare (Key, T->Func->GetKey (N->Entry))) {
|
||||
/* Found */
|
||||
break;
|
||||
}
|
||||
@@ -133,8 +133,8 @@ void HT_Insert (HashTable* T, HashNode* N)
|
||||
HT_Alloc (T);
|
||||
}
|
||||
|
||||
/* Generate the hash for the node contents */
|
||||
N->Hash = T->Func->GenHash (T->Func->GetIndex (N->Entry));
|
||||
/* Generate the hash over the node key. */
|
||||
N->Hash = T->Func->GenHash (T->Func->GetKey (N->Entry));
|
||||
|
||||
/* Calculate the reduced hash */
|
||||
RHash = N->Hash % T->Slots;
|
||||
@@ -143,6 +143,9 @@ void HT_Insert (HashTable* T, HashNode* N)
|
||||
N->Next = T->Table[RHash];
|
||||
T->Table[RHash] = N;
|
||||
|
||||
/* Set the owner */
|
||||
N->Owner = T;
|
||||
|
||||
/* One more entry */
|
||||
++T->Count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user