*/
int dbg_PrintHash(HashList *Hash, PrintHashContent First, PrintHashContent Second)
{
+#ifdef DEBUG
const char *foo;
const char *bar;
const char *bla = "";
+#endif
long key;
long i;
if (Hash->LookupTable[i] == NULL)
{
+#ifdef DEBUG
foo = "";
bar = "";
+#endif
+
key = 0;
}
else
key = Hash->LookupTable[i]->Key;
foo = Hash->LookupTable[i]->HashKey;
if (First != NULL)
- bar = First(Hash->Members[Hash->LookupTable[i]->Position]->Data);
+#ifdef DEBUG
+ bar =
+#endif
+ First(Hash->Members[Hash->LookupTable[i]->Position]->Data);
+#ifdef DEBUG
else
bar = "";
+#endif
+
if (Second != NULL)
- bla = Second(Hash->Members[Hash->LookupTable[i]->Position]->Data);
+#ifdef DEBUG
+ bla =
+#endif
+ Second(Hash->Members[Hash->LookupTable[i]->Position]->Data);
+#ifdef DEBUG
+
else
bla = "";
+#endif
+
}
#ifdef DEBUG
printf (" ---- Hashkey[%ld][%ld]: '%s' Value: '%s' ; %s\n", i, key, foo, bar, bla);
/** oh, we're brand new... */
if (Hash->LookupTable[HashAt] == NULL) {
InsertHashItem(Hash, HashAt, HashBinKey, HKey, HKLen, Data, DeleteIt);
- }/** Insert After? */
+ }/** Insert Before? */
else if (Hash->LookupTable[HashAt]->Key > HashBinKey) {
InsertHashItem(Hash, HashAt, HashBinKey, HKey, HKLen, Data, DeleteIt);
- }/** Insert before? */
+ }/** Insert After? */
else if (Hash->LookupTable[HashAt]->Key < HashBinKey) {
InsertHashItem(Hash, HashAt + 1, HashBinKey, HKey, HKLen, Data, DeleteIt);
}
return 0;
}
/** GOTCHA! */
- At->Position = Hash->LookupTable[HashAt]->Position;
+ At->Position = HashAt;
return 1;
}