mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
optimize table.all_test_function_names
This commit is contained in:
parent
e9931e6f84
commit
15a2927f09
@ -834,15 +834,21 @@ fn (t &Table) all_test_function_names() []string {
|
||||
fn_end_test_name = f.name
|
||||
}
|
||||
}
|
||||
mut res := []string
|
||||
if fn_begin_test_name.len > 0 {
|
||||
if fn_begin_test_name.len == 0 {
|
||||
if fn_end_test_name.len > 0 {
|
||||
fn_test_names << fn_end_test_name
|
||||
}
|
||||
return fn_test_names
|
||||
}
|
||||
else {
|
||||
mut res := []string
|
||||
res << fn_begin_test_name
|
||||
res << fn_test_names
|
||||
if fn_end_test_name.len > 0 {
|
||||
res << fn_end_test_name
|
||||
}
|
||||
return res
|
||||
}
|
||||
res << fn_test_names
|
||||
if fn_end_test_name.len > 0 {
|
||||
res << fn_end_test_name
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
fn (t &Table) find_const(name string) ?Var {
|
||||
|
Loading…
Reference in New Issue
Block a user