summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-03-30 11:37:54 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-03-30 11:37:54 (GMT)
commitaa371355b1d31208dd1e1c3b5cae011d33a62290 (patch)
tree07701075dc01630cf4902d3d3ae324f4f6531f6d /generic/tclExecute.c
parent4cbd0649efa1b88510c6873aa3f348b58d51b982 (diff)
downloadtcl-aa371355b1d31208dd1e1c3b5cae011d33a62290.zip
tcl-aa371355b1d31208dd1e1c3b5cae011d33a62290.tar.gz
tcl-aa371355b1d31208dd1e1c3b5cae011d33a62290.tar.bz2
Optimize TclStringFirst/TclStringLast: Let it return a Tcl_Obj * in stead of an int, so its callers don't need to do the conversion any more.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 69ddfab..5708772 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5522,19 +5522,17 @@ TEBCresume(
NEXT_INST_V(1, 3, 1);
case INST_STR_FIND:
- match = TclStringFirst(OBJ_UNDER_TOS, OBJ_AT_TOS, 0);
+ objResultPtr = TclStringFirst(OBJ_UNDER_TOS, OBJ_AT_TOS, 0);
TRACE(("%.20s %.20s => %d\n",
- O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), match));
- TclNewIntObj(objResultPtr, match);
+ O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), O2S(objResultPtr)));
NEXT_INST_F(1, 2, 1);
case INST_STR_FIND_LAST:
- match = TclStringLast(OBJ_UNDER_TOS, OBJ_AT_TOS, INT_MAX - 1);
+ objResultPtr = TclStringLast(OBJ_UNDER_TOS, OBJ_AT_TOS, INT_MAX - 1);
TRACE(("%.20s %.20s => %d\n",
- O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), match));
- TclNewIntObj(objResultPtr, match);
+ O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), O2S(objResultPtr)));
NEXT_INST_F(1, 2, 1);
case INST_STR_CLASS: