summaryrefslogtreecommitdiffstats
path: root/generic/tclOOInfo.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-12-17 14:27:44 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-12-17 14:27:44 (GMT)
commit97482cca000b9f31593285d349c05793f79f9863 (patch)
tree3fc38b6e46b5d33eef615fe2dfe8473ddfeb3aa7 /generic/tclOOInfo.c
parent73eeb5f121c51edba58ed7deaa273a7381110e26 (diff)
downloadtcl-97482cca000b9f31593285d349c05793f79f9863.zip
tcl-97482cca000b9f31593285d349c05793f79f9863.tar.gz
tcl-97482cca000b9f31593285d349c05793f79f9863.tar.bz2
Slim down the code a bit more; we can make more safe assumptions.
Diffstat (limited to 'generic/tclOOInfo.c')
-rw-r--r--generic/tclOOInfo.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c
index 3f37a6d..5be9b01 100644
--- a/generic/tclOOInfo.c
+++ b/generic/tclOOInfo.c
@@ -100,6 +100,7 @@ TclOOInitInfo(
Tcl_Interp *interp)
{
Tcl_Command infoCmd;
+ Tcl_Obj *mapDict;
/*
* Build the ensembles used to implement [info object] and [info class].
@@ -113,19 +114,12 @@ TclOOInitInfo(
*/
infoCmd = Tcl_FindCommand(interp, "info", NULL, TCL_GLOBAL_ONLY);
- if (infoCmd != NULL && Tcl_IsEnsemble(infoCmd)) {
- Tcl_Obj *mapDict;
-
- Tcl_GetEnsembleMappingDict(NULL, infoCmd, &mapDict);
- if (mapDict != NULL) {
-
- Tcl_DictObjPut(NULL, mapDict, Tcl_NewStringObj("object", -1),
- Tcl_NewStringObj("::oo::InfoObject", -1));
- Tcl_DictObjPut(NULL, mapDict, Tcl_NewStringObj("class", -1),
- Tcl_NewStringObj("::oo::InfoClass", -1));
- Tcl_SetEnsembleMappingDict(interp, infoCmd, mapDict);
- }
- }
+ Tcl_GetEnsembleMappingDict(NULL, infoCmd, &mapDict);
+ Tcl_DictObjPut(NULL, mapDict, Tcl_NewStringObj("object", -1),
+ Tcl_NewStringObj("::oo::InfoObject", -1));
+ Tcl_DictObjPut(NULL, mapDict, Tcl_NewStringObj("class", -1),
+ Tcl_NewStringObj("::oo::InfoClass", -1));
+ Tcl_SetEnsembleMappingDict(interp, infoCmd, mapDict);
}
/*