diff options
author | hobbs <hobbs@noemail.net> | 2010-09-22 00:57:09 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2010-09-22 00:57:09 (GMT) |
commit | 48363a3947f253ec251bd0b10d9f1cd1795e569b (patch) | |
tree | 356a5957b976f2062a12f31fac69730677ca8a7a /generic/tclOOMethod.c | |
parent | c45601c2c242043177ae5c962805080cd5f69a93 (diff) | |
download | tcl-48363a3947f253ec251bd0b10d9f1cd1795e569b.zip tcl-48363a3947f253ec251bd0b10d9f1cd1795e569b.tar.gz tcl-48363a3947f253ec251bd0b10d9f1cd1795e569b.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.
FossilOrigin-Name: 9dc86adce744657674fe3c8a0dac07f44f47f583
Diffstat (limited to 'generic/tclOOMethod.c')
-rw-r--r-- | generic/tclOOMethod.c | 14 |
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; } |