diff options
author | dgp <dgp@users.sourceforge.net> | 2016-07-13 19:06:22 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-07-13 19:06:22 (GMT) |
commit | ab2a78be642be26075e2998347d71359a6b3c500 (patch) | |
tree | 30640bd9d81f1c2ebb578d5aae95f27240b26854 /generic/tclFCmd.c | |
parent | 800148e0621ab1e28457aa915d37dd5c36c1ba77 (diff) | |
download | tcl-ab2a78be642be26075e2998347d71359a6b3c500.zip tcl-ab2a78be642be26075e2998347d71359a6b3c500.tar.gz tcl-ab2a78be642be26075e2998347d71359a6b3c500.tar.bz2 |
New private flag value INDEX_TEMP_TABLE.
Used to signal to Tcl_GetIndexFromObj*() routines that the table in which
lookups are done has a fleeting existence. Thus there is no value in caching
any results, since the cache can never be useful. Improvement over existing
hackery where cache is stored and then freed to avoid bogus results.
Likely candidate to eventually push to the public interface.
Diffstat (limited to 'generic/tclFCmd.c')
-rw-r--r-- | generic/tclFCmd.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index bb814ea..80898fc 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -1079,12 +1079,9 @@ TclFileAttrsCmd( } if (Tcl_GetIndexFromObj(interp, objv[0], attributeStrings, - "option", 0, &index) != TCL_OK) { + "option", INDEX_TEMP_TABLE, &index) != TCL_OK) { goto end; } - if (attributeStringsAllocated != NULL) { - TclFreeIntRep(objv[0]); - } if (Tcl_FSFileAttrsGet(interp, index, filePtr, &objPtr) != TCL_OK) { goto end; @@ -1107,12 +1104,9 @@ TclFileAttrsCmd( for (i = 0; i < objc ; i += 2) { if (Tcl_GetIndexFromObj(interp, objv[i], attributeStrings, - "option", 0, &index) != TCL_OK) { + "option", INDEX_TEMP_TABLE, &index) != TCL_OK) { goto end; } - if (attributeStringsAllocated != NULL) { - TclFreeIntRep(objv[i]); - } if (i + 1 == objc) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", TclGetString(objv[i]))); |