diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-01-28 21:34:29 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-01-28 21:34:29 (GMT) |
commit | af3406f86c40c78cff50cb5003b8be0eae448d54 (patch) | |
tree | 8c012550c364d8277f009fec2d98678544ae8d9b /generic/tclExecute.c | |
parent | 4247e597c6de977b80205b4c28784465ee05f941 (diff) | |
download | tcl-af3406f86c40c78cff50cb5003b8be0eae448d54.zip tcl-af3406f86c40c78cff50cb5003b8be0eae448d54.tar.gz tcl-af3406f86c40c78cff50cb5003b8be0eae448d54.tar.bz2 |
New internal macro TclFetchIntRep, which is faster than Tcl_FetchIntRep.
But ... don't use this function when the result is only compared to NULL: that's just overkill.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 06403c7..897e2cd 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -750,7 +750,7 @@ ReleaseDictIterator( Tcl_Obj *dictPtr; const Tcl_ObjIntRep *irPtr; - irPtr = Tcl_FetchIntRep(objPtr, &dictIteratorType); + irPtr = TclFetchIntRep(objPtr, &dictIteratorType); assert(irPtr != NULL); /* @@ -4768,7 +4768,7 @@ TEBCresume( */ if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK) - && (NULL == Tcl_FetchIntRep(value2Ptr, &tclListType)) + && (value2Ptr->typePtr != &tclListType) && (TclGetIntForIndexM(NULL, value2Ptr, objc-1, &index) == TCL_OK)) { TclDecrRefCount(value2Ptr); @@ -7108,7 +7108,7 @@ TEBCresume( } varPtr = LOCAL(opnd); if (varPtr->value.objPtr) { - if (Tcl_FetchIntRep(varPtr->value.objPtr, &dictIteratorType)) { + if (varPtr->value.objPtr->typePtr == &dictIteratorType) { Tcl_Panic("mis-issued dictFirst!"); } TclDecrRefCount(varPtr->value.objPtr); @@ -7125,7 +7125,7 @@ TEBCresume( const Tcl_ObjIntRep *irPtr; if (statePtr && - (irPtr = Tcl_FetchIntRep(statePtr, &dictIteratorType))) { + (irPtr = TclFetchIntRep(statePtr, &dictIteratorType))) { searchPtr = irPtr->twoPtrValue.ptr1; Tcl_DictObjNext(searchPtr, &keyPtr, &valuePtr, &done); } else { @@ -9622,7 +9622,7 @@ EvalStatsCmd( for (i = 0; i < globalTablePtr->numBuckets; i++) { for (entryPtr = globalTablePtr->buckets[i]; entryPtr != NULL; entryPtr = entryPtr->nextPtr) { - if (NULL != Tcl_FetchIntRep(entryPtr->objPtr, &tclByteCodeType)) { + if (entryPtr->objPtr->typePtr == &tclByteCodeType) { numByteCodeLits++; } (void) TclGetStringFromObj(entryPtr->objPtr, &length); |