Replace compiler for loops for the hash-table types to simplify code usage

This commit is contained in:
gingerBill
2022-12-09 11:29:28 +00:00
parent ffe953b43d
commit 34a048f7da
18 changed files with 269 additions and 209 deletions
+2 -3
View File
@@ -3455,9 +3455,8 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32
error(ce->args[0], "Expected a constant string for '%.*s'", LIT(builtin_name));
} else if (operand->value.kind == ExactValue_String) {
String pkg_name = operand->value.value_string;
// TODO(bill): probably should have this be a `StringMap` eventually
for_array(i, c->info->packages.entries) {
AstPackage *pkg = c->info->packages.entries[i].value;
for (auto const &entry : c->info->packages) {
AstPackage *pkg = entry.value;
if (pkg->name == pkg_name) {
value = true;
break;