parser: minor optimization in call_expr() (#10809)

pull/10819/head
yuyi 2021-07-15 22:47:59 +08:00 committed by GitHub
parent ddaac5af92
commit aca66d503d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ pub fn (mut p Parser) call_expr(language ast.Language, mod string) ast.CallExpr
// In case of `foo<T>()`
// T is unwrapped and registered in the checker.
full_generic_fn_name := if fn_name.contains('.') { fn_name } else { p.prepend_mod(fn_name) }
has_generic := concrete_types.filter(it.has_flag(.generic)).len > 0
has_generic := concrete_types.any(it.has_flag(.generic))
if !has_generic {
// will be added in checker
p.table.register_fn_concrete_types(full_generic_fn_name, concrete_types)