Repository: lucy-clownfish
Updated Branches:
  refs/heads/markdown_v2 b6de550ac -> e7d70dd76


Optimize S_man_create_fresh_methods


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/17c9ce30
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/17c9ce30
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/17c9ce30

Branch: refs/heads/markdown_v2
Commit: 17c9ce30f6e8285da037307c66e374fd4d04c2cc
Parents: fd13936
Author: Nick Wellnhofer <[email protected]>
Authored: Fri Dec 12 18:14:21 2014 +0100
Committer: Nick Wellnhofer <[email protected]>
Committed: Wed Dec 24 14:56:51 2014 +0100

----------------------------------------------------------------------
 compiler/src/CFCCMan.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/17c9ce30/compiler/src/CFCCMan.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCCMan.c b/compiler/src/CFCCMan.c
index b9a05f0..9753c97 100644
--- a/compiler/src/CFCCMan.c
+++ b/compiler/src/CFCCMan.c
@@ -233,24 +233,24 @@ S_man_create_methods(CFCClass *klass) {
 
 static char*
 S_man_create_fresh_methods(CFCClass *klass, CFCClass *ancestor) {
-    CFCMethod  **fresh_methods = CFCClass_fresh_methods(ancestor);
+    CFCMethod  **fresh_methods = CFCClass_fresh_methods(klass);
     const char  *ancestor_name = CFCClass_get_class_name(ancestor);
     char        *result        = CFCUtil_strdup("");
 
     for (int meth_num = 0; fresh_methods[meth_num] != NULL; meth_num++) {
-        CFCMethod *ancestor_method = fresh_methods[meth_num];
-        if (!CFCMethod_public(ancestor_method)) {
+        CFCMethod *method = fresh_methods[meth_num];
+        if (!CFCMethod_public(method)) {
             continue;
         }
 
-        const char *macro_sym = CFCMethod_get_macro_sym(ancestor_method);
-        CFCMethod *method = CFCClass_method(klass, macro_sym);
         const char *class_name = CFCMethod_get_class_name(method);
         if (strcmp(class_name, ancestor_name) != 0) {
-            // Overridden by a subclass.
+            // The method is implementated in a subclass and already
+            // documented.
             continue;
         }
 
+        const char *macro_sym = CFCMethod_get_macro_sym(method);
         result = CFCUtil_cat(result, ".TP\n.BR ", macro_sym, NULL);
         if (CFCMethod_abstract(method)) {
             result = CFCUtil_cat(result, " \" (abstract)\"", NULL);

Reply via email to