diff options
author | sebres <sebres@users.sourceforge.net> | 2024-06-12 19:11:29 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2024-06-12 19:11:29 (GMT) |
commit | c0602af1ad679af5d001d79c58d9811ef9cc476a (patch) | |
tree | 0981222e254798c2f532a2a3326f91fc0a34cf0f /generic/tclCmdIL.c | |
parent | 2fbd19a32f90bb8e5a15d768020565494ba58ff7 (diff) | |
download | tcl-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.c | 5 |
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) { |