summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-07-15 17:07:51 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-07-15 17:07:51 (GMT)
commita398b126a43e46efa6d6044b0bcf57a4b9385c4e (patch)
tree90b87619753141befd59aa2e3dc83c3448bc85ce
parent5e4c2308ce99d3d1349d0defd0585b05cd11e3fe (diff)
downloadtcl-a398b126a43e46efa6d6044b0bcf57a4b9385c4e.zip
tcl-a398b126a43e46efa6d6044b0bcf57a4b9385c4e.tar.gz
tcl-a398b126a43e46efa6d6044b0bcf57a4b9385c4e.tar.bz2
Prefer CompileWord() over CompileTokens() when possible.
-rw-r--r--generic/tclCompCmds.c3
-rw-r--r--generic/tclCompCmdsGR.c3
-rw-r--r--generic/tclCompCmdsSZ.c3
3 files changed, 3 insertions, 6 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 561d816..37ce335 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -2638,8 +2638,7 @@ CompileEachloopCmd(
i < numWords-1;
i++, tokenPtr = TokenAfter(tokenPtr)) {
if ((i%2 == 0) && (i > 0)) {
- SetLineInformation(i);
- CompileTokens(envPtr, tokenPtr, interp);
+ CompileWord(envPtr, tokenPtr, interp, i);
tempVar = (firstValueTemp + loopIndex);
Emit14Inst( INST_STORE_SCALAR, tempVar, envPtr);
TclEmitOpcode( INST_POP, envPtr);
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index 0572cd3..2c71dc5 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -699,8 +699,7 @@ TclCompileInfoLevelCmd(
* list of arguments.
*/
- SetLineInformation(1);
- CompileTokens(envPtr, TokenAfter(parsePtr->tokenPtr), interp);
+ CompileWord(envPtr, TokenAfter(parsePtr->tokenPtr), interp, 1);
TclEmitOpcode( INST_INFO_LEVEL_ARGS, envPtr);
}
return TCL_OK;
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index 19e636d..3a91c83 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -1282,8 +1282,7 @@ TclCompileSwitchCmd(
*/
/* Both methods push the value to match against onto the stack. */
- SetLineInformation(valueIndex);
- CompileTokens(envPtr, valueTokenPtr, interp);
+ CompileWord(envPtr, valueTokenPtr, interp, valueIndex);
if (mode == Switch_Exact) {
IssueSwitchJumpTable(interp, envPtr, valueIndex, numWords, bodyToken,