Reduce unnecessary map gets

This commit is contained in:
gingerBill
2022-09-21 13:03:13 +01:00
parent 769d8dd038
commit ff97a73152
7 changed files with 103 additions and 54 deletions
+2 -1
View File
@@ -296,7 +296,8 @@ clear_map :: proc "contextless" (m: ^$T/map[$K]$V) {
@builtin
reserve_map :: proc(m: ^$T/map[$K]$V, capacity: int, loc := #caller_location) {
if m != nil {
__dynamic_map_reserve(__get_map_header(m), uint(capacity), loc)
h := __get_map_header_table(T)
__dynamic_map_reserve(m, h, uint(capacity), loc)
}
}