summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdIL.c
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2024-06-12 19:11:29 (GMT)
committersebres <sebres@users.sourceforge.net>2024-06-12 19:11:29 (GMT)
commitc0602af1ad679af5d001d79c58d9811ef9cc476a (patch)
tree0981222e254798c2f532a2a3326f91fc0a34cf0f /generic/tclCmdIL.c
parent2fbd19a32f90bb8e5a15d768020565494ba58ff7 (diff)
downloadtcl-c0602af1ad679af5d001d79c58d9811ef9cc476a.zip
tcl-c0602af1ad679af5d001d79c58d9811ef9cc476a.tar.gz
tcl-c0602af1ad679af5d001d79c58d9811ef9cc476a.tar.bz2
speed-up lseq (with expr-args) a bit, as well as avoid shimmer for compiled expressions
Diffstat (limited to 'generic/tclCmdIL.c')
-rw-r--r--generic/tclCmdIL.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 19bc596..986bd1e 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -4029,6 +4029,10 @@ SequenceIdentifyArgument(
void *internalPtr;
if (allowedArgs & NumericArg) {
+ /* speed-up a bit (and avoid shimmer for compiled expressions) */
+ if (TclHasInternalRep(argPtr, &tclExprCodeType)) {
+ goto doExpr;
+ }
result = Tcl_GetNumberFromObj(NULL, argPtr, &internalPtr, keywordIndexPtr);
if (result == TCL_OK) {
*numValuePtr = argPtr;
@@ -4054,6 +4058,7 @@ SequenceIdentifyArgument(
if (!(allowedArgs & NumericArg)) {
return NoneArg;
}
+ doExpr:
/* Check for an index expression */
int keyword;
if (Tcl_ExprObj(interp, argPtr, &exprValueObj) != TCL_OK) {