From 87ded1784ec9671fff147e67955697f090280d2c Mon Sep 17 00:00:00 2001 From: yuyi Date: Fri, 21 May 2021 11:14:57 +0800 Subject: [PATCH] checker: a minor optimization in file_has_main_fn() (#10143) --- vlib/v/checker/checker.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index c0a886136e..5433457761 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -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 {