Correct map usage

This commit is contained in:
gingerBill
2024-04-26 15:09:08 +01:00
parent 2b26384b89
commit 4bea5dbac1
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -2192,7 +2192,7 @@ gb_internal void add_min_dep_type_info(Checker *c, Type *t) {
// IMPORTANT NOTE(bill): this must be copied as `map_set` takes a const ref
// and effectively assigns the `+1` of the value
isize const count = set->count;
if (map_set_if_not_previously_exists(set, ti_index, count)) {
if (map_set_if_not_previously_exists(set, ti_index+1, count)) {
// Type already exists;
return;
}
+1 -1
View File
@@ -140,7 +140,7 @@ gb_internal bool lb_init_generator(lbGenerator *gen, Checker *c) {
}
gen->default_module.gen = gen;
map_set(&gen->modules, cast(void *)nullptr, &gen->default_module);
map_set(&gen->modules, cast(void *)1, &gen->default_module);
lb_init_module(&gen->default_module, c);
+1 -1
View File
@@ -2,7 +2,7 @@ gb_internal isize lb_type_info_index(CheckerInfo *info, Type *type, bool err_on_
auto *set = &info->minimum_dependency_type_info_set;
isize index = type_info_index(info, type, err_on_not_found);
if (index >= 0) {
auto *found = map_get(set, index);
auto *found = map_get(set, index+1);
if (found) {
GB_ASSERT(*found >= 0);
return *found + 1;