checker: a minor optimization in file_has_main_fn() (#10143)
parent
d8cf26aaba
commit
87ded1784e
|
@ -204,7 +204,7 @@ pub fn (mut c Checker) check_files(ast_files []ast.File) {
|
||||||
for {
|
for {
|
||||||
for file in ast_files {
|
for file in ast_files {
|
||||||
if file.generic_fns.len > 0 {
|
if file.generic_fns.len > 0 {
|
||||||
c.change_current_file(file)
|
c.change_current_file(&file)
|
||||||
c.post_process_generic_fns()
|
c.post_process_generic_fns()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ pub fn (mut c Checker) check_files(ast_files []ast.File) {
|
||||||
|
|
||||||
// do checks specific to files in main module
|
// do checks specific to files in main module
|
||||||
// returns `true` if a main function is in the file
|
// returns `true` if a main function is in the file
|
||||||
fn (mut c Checker) file_has_main_fn(file ast.File) bool {
|
fn (mut c Checker) file_has_main_fn(file &ast.File) bool {
|
||||||
mut has_main_fn := false
|
mut has_main_fn := false
|
||||||
for stmt in file.stmts {
|
for stmt in file.stmts {
|
||||||
if stmt is ast.FnDecl {
|
if stmt is ast.FnDecl {
|
||||||
|
|
Loading…
Reference in New Issue