Index: generic/xotcl.c =================================================================== diff -u -r1f0231a5c7cbb8dfef4eaf78335c9ad571863660 -r503b512a56d3e0a64153cbc19dc61c8a819b87b8 --- generic/xotcl.c (.../xotcl.c) (revision 1f0231a5c7cbb8dfef4eaf78335c9ad571863660) +++ generic/xotcl.c (.../xotcl.c) (revision 503b512a56d3e0a64153cbc19dc61c8a819b87b8) @@ -9858,9 +9858,10 @@ char *key; int new; -#if 1 if (pattern && noMetaChars(pattern)) { - /* We have a pattern that can be used for direct lookup; no need to iterate */ + /* We have a pattern that can be used for direct lookup; + * no need to iterate + */ hPtr = table ? XOTcl_FindHashEntry(table, pattern) : 0; if (hPtr) { key = Tcl_GetHashKey(table, hPtr); @@ -9879,9 +9880,6 @@ return TCL_OK; } else { -#else - { -#endif hPtr = table ? Tcl_FirstHashEntry(table, &hSrch) : 0; for (; hPtr; hPtr = Tcl_NextHashEntry(&hSrch)) { @@ -9974,25 +9972,27 @@ } static int -ListMethods(Tcl_Interp *interp, XOTclObject *object, char *pattern, - int withDefined, int withPer_object, int methodType, - int noMixins, int inContext) { - XOTclClasses *pl; - Tcl_HashTable *cmdTable, dupsTable, *dups = &dupsTable; +ListDefinedMethods(Tcl_Interp *interp, XOTclObject *object, char *pattern, + int withPer_object, int methodType, + int noMixins, int inContext) { + Tcl_HashTable *cmdTable; - - /*fprintf(stderr, "listMethods %s %d %d\n", pattern, noMixins, inContext);*/ - - if (withDefined) { - if (XOTclObjectIsClass(object) && !withPer_object) { - cmdTable = Tcl_Namespace_cmdTable(((XOTclClass *)object)->nsPtr); - } else { - cmdTable = object->nsPtr ? Tcl_Namespace_cmdTable(object->nsPtr) : NULL; - } - ListMethodKeys(interp, cmdTable, pattern, methodType, NULL, object, withPer_object); - return TCL_OK; + if (XOTclObjectIsClass(object) && !withPer_object) { + cmdTable = Tcl_Namespace_cmdTable(((XOTclClass *)object)->nsPtr); + } else { + cmdTable = object->nsPtr ? Tcl_Namespace_cmdTable(object->nsPtr) : NULL; } + ListMethodKeys(interp, cmdTable, pattern, methodType, NULL, object, withPer_object); + return TCL_OK; +} +static int +ListCallableMethods(Tcl_Interp *interp, XOTclObject *object, char *pattern, + int withPer_object, int methodType, + int noMixins, int inContext) { + XOTclClasses *pl; + Tcl_HashTable *cmdTable, dupsTable, *dups = &dupsTable; + /* * TODO: we could make this faster for patterns without metachars * by letting ListMethodKeys() to signal us when an entry was found. @@ -12636,14 +12636,14 @@ int withMethodtype, int withNomixins, int withIncontext, char *pattern) { - return ListMethods(interp, &class->object, pattern, 1 /*withDefined*/, 0 /* per-object */, + return ListDefinedMethods(interp, &class->object, pattern, 0 /* per-object */, AggregatedMethodType(withMethodtype), withNomixins, withIncontext); } static int XOTclObjInfoMethodsMethod(Tcl_Interp *interp, XOTclObject *object, int withMethodtype, int withNomixins, int withIncontext, char *pattern) { - return ListMethods(interp, object, pattern, 1 /*withDefined*/, 1 /* per-object */, + return ListDefinedMethods(interp, object, pattern, 1 /* per-object */, AggregatedMethodType(withMethodtype), withNomixins, withIncontext); } /* todo move me to the right place @@ -12663,7 +12663,7 @@ } } - return ListMethods(interp, object, pattern, 0 /* withDefined */, 1 /* per-object */, + return ListCallableMethods(interp, object, pattern, 1 /* per-object */, AggregatedMethodType(withMethodtype), withNomixins, withIncontext); }