summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2010-09-22 00:57:10 (GMT)
committerhobbs <hobbs>2010-09-22 00:57:10 (GMT)
commit4dbb6d9db471aad324a4f71344df2306e988e48b (patch)
tree356a5957b976f2062a12f31fac69730677ca8a7a /generic/tclExecute.c
parentd233fd15ae3557d7fee760120f736c0a0a90bae2 (diff)
downloadtcl-4dbb6d9db471aad324a4f71344df2306e988e48b.zip
tcl-4dbb6d9db471aad324a4f71344df2306e988e48b.tar.gz
tcl-4dbb6d9db471aad324a4f71344df2306e988e48b.tar.bz2
* generic/tclOOMethod.c (ProcedureMethodCompiledVarConnect):
* generic/tclVar.c (TclLookupSimpleVar, CompareVarKeys): * generic/tclPathObj.c (Tcl_FSGetNormalizedPath, Tcl_FSEqualPaths): * generic/tclExecute.c (TclExecuteByteCode): * generic/tclIOUtil.c (TclFSCwdPointerEquals): peephole opt * generic/tclResult.c (TclMergeReturnOptions): use memcmp where applicable as possible speedup on some libc variants.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 6a4b495..71999d2 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.494 2010/09/01 20:35:33 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.495 2010/09/22 00:57:11 hobbs Exp $
*/
#include "tclInt.h"
@@ -4454,7 +4454,6 @@ TclExecuteByteCode(
value2Ptr = OBJ_AT_TOS;
valuePtr = OBJ_UNDER_TOS;
- /* TODO: Consider more efficient tests than strcmp() */
s1 = TclGetStringFromObj(valuePtr, &s1len);
if (TclListObjLength(interp, value2Ptr, &length) != TCL_OK) {
TRACE_WITH_OBJ(("\"%.30s\" \"%.30s\" => ERROR: ", O2S(valuePtr),
@@ -4479,7 +4478,7 @@ TclExecuteByteCode(
s2len = 0;
}
if (s1len == s2len) {
- match = (strcmp(s1, s2) == 0);
+ match = (memcmp(s1, s2, s1len) == 0);
}
i++;
} while (i < length && match == 0);
@@ -4545,10 +4544,10 @@ TclExecuteByteCode(
*/
if (*pc == INST_STR_NEQ) {
- match = (strcmp(s1, s2) != 0);
+ match = (memcmp(s1, s2, s1len) != 0);
} else {
/* INST_STR_EQ */
- match = (strcmp(s1, s2) == 0);
+ match = (memcmp(s1, s2, s1len) == 0);
}
} else {
match = (*pc == INST_STR_NEQ);