diff options
author | sebres <sebres@users.sourceforge.net> | 2019-05-21 11:22:36 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2019-05-21 11:22:36 (GMT) |
commit | 245ed0c3c358f72b7b1c4591a0a8e1de80c0fb42 (patch) | |
tree | 7630a208d870b57ed6bca6dd298c18112c42dfbb /generic | |
parent | 543703d4ee015b5c0fb7b4402dbe0701ba47945f (diff) | |
download | tcl-245ed0c3c358f72b7b1c4591a0a8e1de80c0fb42.zip tcl-245ed0c3c358f72b7b1c4591a0a8e1de80c0fb42.tar.gz tcl-245ed0c3c358f72b7b1c4591a0a8e1de80c0fb42.tar.bz2 |
cherry-picing of [3f693cdfe9c875c4] to be more compatible across version, resolve mistake with "key objects/pointers comparison by the hash entry" firstly introduced there.
Diffstat (limited to 'generic')
-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 |