mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: fix slow compilation of vtl/nn/examples/mnist.v (reduce RAM usage)
This commit is contained in:
parent
04f818fefc
commit
d7758b2995
@ -358,10 +358,16 @@ fn (mut c Checker) fn_decl(mut node ast.FnDecl) {
|
||||
}
|
||||
node.source_file = c.file
|
||||
|
||||
if c.table.known_fn(node.name) && node.name != 'main.main' {
|
||||
if node.name in c.table.fns && node.name != 'main.main' {
|
||||
mut dep_names := []string{}
|
||||
for stmt in node.stmts {
|
||||
dep_names << c.table.dependent_names_in_stmt(stmt)
|
||||
dnames := c.table.dependent_names_in_stmt(stmt)
|
||||
for dname in dnames {
|
||||
if dname in dep_names {
|
||||
continue
|
||||
}
|
||||
dep_names << dname
|
||||
}
|
||||
}
|
||||
if dep_names.len > 0 {
|
||||
c.table.fns[node.name].dep_names = dep_names
|
||||
|
Loading…
Reference in New Issue
Block a user