diff options
author | dgp <dgp@users.sourceforge.net> | 2014-12-22 19:57:36 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-12-22 19:57:36 (GMT) |
commit | e3e2ea19a40931da26882d9bbc7ff94a2cc001c9 (patch) | |
tree | 7bc810dd408033761ce772a6bbdf70df7961f3d1 | |
parent | 56ee5af5c3d70bbbf37d9512c58da0b063d9d76a (diff) | |
download | tcl-e3e2ea19a40931da26882d9bbc7ff94a2cc001c9.zip tcl-e3e2ea19a40931da26882d9bbc7ff94a2cc001c9.tar.gz tcl-e3e2ea19a40931da26882d9bbc7ff94a2cc001c9.tar.bz2 |
More complete use of the TCL_NO_ELEMENT flag to suppress useless actions.
-rw-r--r-- | generic/tclCompCmds.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 30c1318..ee9209a 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -3313,7 +3313,7 @@ TclPushVarName( } } - if ((elName != NULL) && elNameChars) { + if (!(flags & TCL_NO_ELEMENT) && (elName != NULL) && elNameChars) { /* * An array element, the element name is a simple string: * assemble the corresponding token. @@ -3366,7 +3366,8 @@ TclPushVarName( remainingChars = (varTokenPtr[2].start - p) - 1; elNameChars = (varTokenPtr[n].start-p) + varTokenPtr[n].size - 1; - if (remainingChars) { + if (!(flags & TCL_NO_ELEMENT)) { + if (remainingChars) { /* * Make a first token with the extra characters in the first * token. @@ -3386,13 +3387,14 @@ TclPushVarName( memcpy(elemTokenPtr+1, varTokenPtr+2, (n-1) * sizeof(Tcl_Token)); - } else { + } else { /* * Use the already available tokens. */ elemTokenPtr = &varTokenPtr[2]; elemTokenCount = n - 1; + } } } } |