diff options
-rw-r--r-- | generic/tclHash.c | 5 | ||||
-rw-r--r-- | generic/tclObj.c | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/generic/tclHash.c b/generic/tclHash.c index 5d6ea86..837a167 100644 --- a/generic/tclHash.c +++ b/generic/tclHash.c @@ -324,7 +324,10 @@ CreateHashEntry( continue; } #endif - if (compareKeysProc((VOID *) key, hPtr)) { + /* if keys pointers or values are equal */ + if (((void *) key == hPtr->key.oneWordValue) + || compareKeysProc((VOID *) key, hPtr) + ) { if (newPtr) { *newPtr = 0; } diff --git a/generic/tclObj.c b/generic/tclObj.c index a283dd8..1738985 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -3921,11 +3921,10 @@ TclCompareObjKeys( /* * If the object pointers are the same then they match. - */ + * OPT: this comparison was moved to the caller - if (objPtr1 == objPtr2) { - return 1; - } + if (objPtr1 == objPtr2) return 1; + */ /* * Don't use Tcl_GetStringFromObj as it would prevent l1 and l2 being |