1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

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>()` // In case of `foo<T>()`
// T is unwrapped and registered in the checker. // T is unwrapped and registered in the checker.
full_generic_fn_name := if fn_name.contains('.') { fn_name } else { p.prepend_mod(fn_name) } 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 { if !has_generic {
// will be added in checker // will be added in checker
p.table.register_fn_concrete_types(full_generic_fn_name, concrete_types) p.table.register_fn_concrete_types(full_generic_fn_name, concrete_types)