summaryrefslogtreecommitdiffstats
path: root/generic/tclOOInfo.c
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2012-12-13 19:43:43 (GMT)
committerdgp <dgp@noemail.net>2012-12-13 19:43:43 (GMT)
commit555299e71ad51fa058703363884dfcd85b295408 (patch)
treeeb202e0c90643dabbb7d7e0e81619d43fb11a57f /generic/tclOOInfo.c
parentbbaed9a6be3acfa8a89932437a77cfaf3db8a0f9 (diff)
downloadtcl-555299e71ad51fa058703363884dfcd85b295408.zip
tcl-555299e71ad51fa058703363884dfcd85b295408.tar.gz
tcl-555299e71ad51fa058703363884dfcd85b295408.tar.bz2
Simplify the [info object] and [info class] additions.
FossilOrigin-Name: 3184e01afdf16b1b4ecb6d765e4cb53785a1be40
Diffstat (limited to 'generic/tclOOInfo.c')
-rw-r--r--generic/tclOOInfo.c12
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);
}
}