summaryrefslogtreecommitdiffstats
path: root/generic/tclHash.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclHash.c')
-rw-r--r--generic/tclHash.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/generic/tclHash.c b/generic/tclHash.c
index 742691c..c72dc6d 100644
--- a/generic/tclHash.c
+++ b/generic/tclHash.c
@@ -320,13 +320,16 @@ CreateHashEntry(
return hPtr;
}
}
- } else { /* no direct compare */
+ } else { /* no direct compare - compare key addresses only */
for (hPtr = tablePtr->buckets[index]; hPtr != NULL;
hPtr = hPtr->nextPtr) {
if (hash != PTR2UINT(hPtr->hash)) {
continue;
}
- if (compareKeysProc((void *) key, hPtr)) {
+ /* if needle pointer equals content pointer or values equal */
+ if ((key == hPtr->key.string)
+ || compareKeysProc((void *) key, hPtr)
+ ) {
if (newPtr) {
*newPtr = 0;
}