Tcl Source Code

Check-in [adf768a9ff]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to [email protected]
or submit via the online form by Aug 20.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:optimize compiled (INST_STR_TRIM): use new function TclTrim instead of combination of TclTrimLeft/TclTrimRight
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-6-branch
Files: files | file ages | folders
SHA3-256:adf768a9ff0dbbccf2262e5d09580a0d9884f555e8f4e989d12234db3e6b35dd
User & Date: sebres 2018-03-14 17:23:24
Context
2018-03-14
22:17
Memleak and lifetime management fixes for components of the OO system. check-in: 7041be160d user: dgp tags: core-8-6-branch
21:51
merge 8.6 Closed-Leaf check-in: 6ef924a457 user: dgp tags: memleak
18:08
merge 8.6 check-in: 010cc4a688 user: dgp tags: core-8-branch
17:23
optimize compiled (INST_STR_TRIM): use new function TclTrim instead of combination of TclTrimLeft/Tc... check-in: adf768a9ff user: sebres tags: core-8-6-branch
17:19
merge 8.5 check-in: d1142036a0 user: sebres tags: core-8-6-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclExecute.c.

6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
	trim1 = 0;
	goto createTrimmedString;
    case INST_STR_TRIM:
	valuePtr = OBJ_UNDER_TOS;	/* String */
	value2Ptr = OBJ_AT_TOS;		/* TrimSet */
	string2 = TclGetStringFromObj(value2Ptr, &length2);
	string1 = TclGetStringFromObj(valuePtr, &length);
	trim1 = TclTrimLeft(string1, length, string2, length2);
	if (trim1 < length) {
	    trim2 = TclTrimRight(string1, length, string2, length2);
	} else {
	    trim2 = 0;
	}
    createTrimmedString:
	/*
	 * Careful here; trim set often contains non-ASCII characters so we
	 * take care when printing. [Bug 971cb4f1db]
	 */

#ifdef TCL_COMPILE_DEBUG






|
<
<
<
<
<







6018
6019
6020
6021
6022
6023
6024
6025





6026
6027
6028
6029
6030
6031
6032
	trim1 = 0;
	goto createTrimmedString;
    case INST_STR_TRIM:
	valuePtr = OBJ_UNDER_TOS;	/* String */
	value2Ptr = OBJ_AT_TOS;		/* TrimSet */
	string2 = TclGetStringFromObj(value2Ptr, &length2);
	string1 = TclGetStringFromObj(valuePtr, &length);
	trim1 = TclTrim(string1, length, string2, length2, &trim2);





    createTrimmedString:
	/*
	 * Careful here; trim set often contains non-ASCII characters so we
	 * take care when printing. [Bug 971cb4f1db]
	 */

#ifdef TCL_COMPILE_DEBUG