parser,util: improve libleak false positive detection rate

pull/12360/head
Delyan Angelov 2021-10-29 16:35:58 +03:00
parent 3d800b12e8
commit 4c67c01e72
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
3 changed files with 3 additions and 2 deletions

View File

@ -18,7 +18,7 @@ fn (p &Parser) prepend_mod(name string) string {
if p.builtin_mod {
return name
}
return '${p.mod}.$name'
return p.mod + '.' + name
}
fn (p &Parser) is_used_import(alias string) bool {

View File

@ -419,7 +419,7 @@ pub fn (mut p Parser) parse_block() []ast.Stmt {
pub fn (mut p Parser) parse_block_no_scope(is_top_level bool) []ast.Stmt {
p.check(.lcbr)
mut stmts := []ast.Stmt{}
mut stmts := []ast.Stmt{cap: 20}
if p.tok.kind != .rcbr {
mut count := 0
for p.tok.kind !in [.eof, .rcbr] {

View File

@ -18,6 +18,7 @@ pub fn new_timers(should_print bool) &Timers {
return &Timers{
swatches: map[string]time.StopWatch{}
should_print: should_print
already_shown: []string{cap: 100}
}
}