diff options
author | dgp <dgp@users.sourceforge.net> | 2012-12-13 19:43:43 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2012-12-13 19:43:43 (GMT) |
commit | 73eeb5f121c51edba58ed7deaa273a7381110e26 (patch) | |
tree | eb202e0c90643dabbb7d7e0e81619d43fb11a57f | |
parent | a555b6e7aaf7b6d30b29e65984f3a96f0435e184 (diff) | |
download | tcl-73eeb5f121c51edba58ed7deaa273a7381110e26.zip tcl-73eeb5f121c51edba58ed7deaa273a7381110e26.tar.gz tcl-73eeb5f121c51edba58ed7deaa273a7381110e26.tar.bz2 |
Simplify the [info object] and [info class] additions.
-rw-r--r-- | generic/tclOOInfo.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c index e09ee4e..3f37a6d 100644 --- a/generic/tclOOInfo.c +++ b/generic/tclOOInfo.c @@ -114,21 +114,15 @@ TclOOInitInfo( infoCmd = Tcl_FindCommand(interp, "info", NULL, TCL_GLOBAL_ONLY); if (infoCmd != NULL && Tcl_IsEnsemble(infoCmd)) { - Tcl_Obj *mapDict, *objectObj, *classObj; + Tcl_Obj *mapDict; Tcl_GetEnsembleMappingDict(NULL, infoCmd, &mapDict); if (mapDict != NULL) { - objectObj = Tcl_NewStringObj("object", -1); - classObj = Tcl_NewStringObj("class", -1); - Tcl_IncrRefCount(objectObj); - Tcl_IncrRefCount(classObj); - Tcl_DictObjPut(NULL, mapDict, objectObj, + Tcl_DictObjPut(NULL, mapDict, Tcl_NewStringObj("object", -1), Tcl_NewStringObj("::oo::InfoObject", -1)); - Tcl_DictObjPut(NULL, mapDict, classObj, + Tcl_DictObjPut(NULL, mapDict, Tcl_NewStringObj("class", -1), Tcl_NewStringObj("::oo::InfoClass", -1)); - Tcl_DecrRefCount(objectObj); - Tcl_DecrRefCount(classObj); Tcl_SetEnsembleMappingDict(interp, infoCmd, mapDict); } } |