v.table: minimize re-allocations on << to table.types

pull/8906/head
Delyan Angelov 2021-02-22 16:24:57 +02:00
parent 2516c07614
commit 467dce6be6
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 3 additions and 1 deletions

View File

@ -86,7 +86,9 @@ mut:
}
pub fn new_table() &Table {
mut t := &Table{}
mut t := &Table{
types: []TypeSymbol{cap: 64000}
}
t.register_builtin_type_symbols()
t.is_fmt = true
return t