Attachment "cmdName.patch" to
ticket [456668ffff]
added by
msofer
2001-08-30 19:11:02.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcl/tcl/ChangeLog,v
retrieving revision 1.546
diff -r1.546 ChangeLog
0a1,8
> 2001-08-30 Miguel Sofer <[email protected]>
>
> * generic/tclExecute.c: allow cached fully-qualified command names
> to be usable from different namespaces within the same interpreter
> without forcing a new lookup. This speeds up scripts that pass
> command names in variables ("this" in some OO packages).
> [Patch 456668].
>
Index: generic/tclExecute.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclExecute.c,v
retrieving revision 1.26
diff -r1.26 tclExecute.c
5339a5340,5355
> CallFrame *savedFramePtr;
> char *name;
>
> /*
> * If the variable name is fully qualified, do as if the lookup were
> * done from the global namespace; this helps avoid repeated lookups
> * of fully qualified names. It costs close to nothing, and may be very
> * helpful for OO applications which pass along a command name ("this"),
> * [Patch 456668]
> */
>
> savedFramePtr = iPtr->varFramePtr;
> name = Tcl_GetString(objPtr);
> if ((*name++ == ':') && (*name == ':')) {
> iPtr->varFramePtr = NULL;
> }
5349a5366
> iPtr->varFramePtr = savedFramePtr;
5395a5413
> iPtr->varFramePtr = savedFramePtr;