summaryrefslogtreecommitdiffstats
path: root/generic/tclOOMethod.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/tclOOMethod.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/tclOOMethod.c')
-rw-r--r--generic/tclOOMethod.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c
index 9f5be6b..3b9e700 100644
--- a/generic/tclOOMethod.c
+++ b/generic/tclOOMethod.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclOOMethod.c,v 1.26 2010/03/24 13:21:11 dkf Exp $
+ * RCS: @(#) $Id: tclOOMethod.c,v 1.27 2010/09/22 00:57:11 hobbs Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -994,8 +994,10 @@ ProcedureMethodCompiledVarConnect(
CallContext *contextPtr;
Tcl_Obj *variableObj;
Tcl_HashEntry *hPtr;
- int i, isNew, cacheIt;
- const char *varName = Tcl_GetString(infoPtr->variableObj);
+ int i, isNew, cacheIt, varLen, len;
+ const char *match, *varName;
+
+ varName = TclGetStringFromObj(infoPtr->variableObj, &varLen);
/*
* Check that the variable is being requested in a context that is also a
@@ -1027,14 +1029,16 @@ ProcedureMethodCompiledVarConnect(
.mPtr->declaringClassPtr != NULL) {
FOREACH(variableObj, contextPtr->callPtr->chain[contextPtr->index]
.mPtr->declaringClassPtr->variables) {
- if (!strcmp(Tcl_GetString(variableObj), varName)) {
+ match = TclGetStringFromObj(variableObj, &len);
+ if ((len == varLen) && !memcmp(match, varName, len)) {
cacheIt = 0;
goto gotMatch;
}
}
} else {
FOREACH(variableObj, contextPtr->oPtr->variables) {
- if (!strcmp(Tcl_GetString(variableObj), varName)) {
+ match = TclGetStringFromObj(variableObj, &len);
+ if ((len == varLen) && !memcmp(match, varName, len)) {
cacheIt = 1;
goto gotMatch;
}