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/tclIndexObj.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/tclIndexObj.c')
-rw-r--r-- | generic/tclIndexObj.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index c39c0dc..965ec24 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -123,7 +123,7 @@ Tcl_GetIndexFromObj( * the common case where the result is cached). */ - const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objPtr, &indexType); + const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &indexType); if (irPtr) { IndexRep *indexRep = irPtr->twoPtrValue.ptr1; @@ -282,7 +282,7 @@ Tcl_GetIndexFromObjStruct( */ if (!(flags & INDEX_TEMP_TABLE)) { - irPtr = Tcl_FetchIntRep(objPtr, &indexType); + irPtr = TclFetchIntRep(objPtr, &indexType); if (irPtr) { indexRep = irPtr->twoPtrValue.ptr1; if (indexRep->tablePtr==tablePtr && indexRep->offset==offset) { @@ -346,7 +346,7 @@ Tcl_GetIndexFromObjStruct( */ if (!(flags & INDEX_TEMP_TABLE)) { - irPtr = Tcl_FetchIntRep(objPtr, &indexType); + irPtr = TclFetchIntRep(objPtr, &indexType); if (irPtr) { indexRep = irPtr->twoPtrValue.ptr1; } else { @@ -457,7 +457,7 @@ static void UpdateStringOfIndex( Tcl_Obj *objPtr) { - IndexRep *indexRep = Tcl_FetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1; + IndexRep *indexRep = TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1; register const char *indexStr = EXPAND_OF(indexRep); Tcl_InitStringRep(objPtr, indexStr, strlen(indexStr)); @@ -489,7 +489,7 @@ DupIndex( Tcl_ObjIntRep ir; IndexRep *dupIndexRep = ckalloc(sizeof(IndexRep)); - memcpy(dupIndexRep, Tcl_FetchIntRep(srcPtr, &indexType)->twoPtrValue.ptr1, + memcpy(dupIndexRep, TclFetchIntRep(srcPtr, &indexType)->twoPtrValue.ptr1, sizeof(IndexRep)); ir.twoPtrValue.ptr1 = dupIndexRep; @@ -517,7 +517,7 @@ static void FreeIndex( Tcl_Obj *objPtr) { - ckfree(Tcl_FetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1); + ckfree(TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1); objPtr->typePtr = NULL; } @@ -966,7 +966,7 @@ Tcl_WrongNumArgs( */ const Tcl_ObjIntRep *irPtr; - if ((irPtr = Tcl_FetchIntRep(origObjv[i], &indexType))) { + if ((irPtr = TclFetchIntRep(origObjv[i], &indexType))) { register IndexRep *indexRep = irPtr->twoPtrValue.ptr1; elementStr = EXPAND_OF(indexRep); @@ -1016,7 +1016,7 @@ Tcl_WrongNumArgs( */ const Tcl_ObjIntRep *irPtr; - if ((irPtr = Tcl_FetchIntRep(objv[i], &indexType))) { + if ((irPtr = TclFetchIntRep(objv[i], &indexType))) { register IndexRep *indexRep = irPtr->twoPtrValue.ptr1; Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), NULL); |