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

ast: minor simplification of new_table() (#18795)

This commit is contained in:
yuyi 2023-07-06 18:51:46 +08:00 committed by GitHub
parent 8f7f2c8cf7
commit b3f89e1417
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,16 +98,12 @@ pub fn new_table() &Table {
} }
t.register_builtin_type_symbols() t.register_builtin_type_symbols()
t.is_fmt = true t.is_fmt = true
set_global_table(t) global_table = t
return t return t
} }
__global global_table = &Table(unsafe { nil }) __global global_table = &Table(unsafe { nil })
pub fn set_global_table(t &Table) {
global_table = t
}
// used to compare fn's & for naming anon fn's // used to compare fn's & for naming anon fn's
pub fn (t &Table) fn_type_signature(f &Fn) string { pub fn (t &Table) fn_type_signature(f &Fn) string {
mut sig := '' mut sig := ''