Commit 392fc858 authored by Etienne Renault's avatar Etienne Renault
Browse files

recusion:blackbox: avoid duplicates for efficiency

* tools/recursion.go:  Here.
parent 01dae085
......@@ -57,8 +57,17 @@ func collectFuncInfo(node *ast.FuncDecl) *FuncInfo {
if node.Name.Name == f.Name {
is_recursive = true
}
calls = append(calls, f.Name)
ok := false
for _, val := range calls {
if val == f.Name {
ok = true
break
}
}
if !ok {
calls = append(calls, f.Name)
}
}
return true
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment