q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9540e96107f7f6f759c3a7ed51d90a8883fc2310

commit 9540e96107f7f6f759c3a7ed51d90a8883fc2310
Author: Daniel Kolesa <[email protected]>
Date:   Thu Feb 9 16:04:59 2017 +0100

    docs: avoid possible duplicates when figuring out all impls of a func
---
 src/scripts/elua/apps/gendoc.lua | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
index 524583a..9cbbf7a 100644
--- a/src/scripts/elua/apps/gendoc.lua
+++ b/src/scripts/elua/apps/gendoc.lua
@@ -1018,7 +1018,12 @@ end
 local impls_of = {}
 
 local get_all_impls_of
-get_all_impls_of = function(tbl, cl, fn)
+get_all_impls_of = function(tbl, cl, fn, got)
+    local cfn = cl:full_name_get()
+    if got[cfn] then
+        return
+    end
+    got[cfn] = true
     for i, imp in ipairs(cl:implements_get()) do
         local ofn = imp:function_get()
         if ofn:is_same(fn) then
@@ -1028,7 +1033,7 @@ get_all_impls_of = function(tbl, cl, fn)
     end
     for i, cln in ipairs(cl:children_get()) do
         local icl = dtree.Class.by_name_get(cln)
-        get_all_impls_of(tbl, icl, fn)
+        get_all_impls_of(tbl, icl, fn, got)
     end
 end
 
@@ -1041,7 +1046,7 @@ local write_ilist = function(f, impl, cl)
     if not imps then
         imps = {}
         impls_of[onm] = imps
-        get_all_impls_of(imps, ocl, fn)
+        get_all_impls_of(imps, ocl, fn, {})
     end
 
     f:write_h("Implemented by", 2)

-- 


Reply via email to