mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: a minor optimization in file_has_main_fn() (#10143)
This commit is contained in:
parent
d8cf26aaba
commit
87ded1784e
@ -204,7 +204,7 @@ pub fn (mut c Checker) check_files(ast_files []ast.File) {
|
||||
for {
|
||||
for file in ast_files {
|
||||
if file.generic_fns.len > 0 {
|
||||
c.change_current_file(file)
|
||||
c.change_current_file(&file)
|
||||
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
|
||||
// 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
|
||||
for stmt in file.stmts {
|
||||
if stmt is ast.FnDecl {
|
||||
|
Loading…
Reference in New Issue
Block a user