diff options
| author | gingerBill <bill@gingerbill.org> | 2022-12-09 11:29:28 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-12-09 11:29:28 +0000 |
| commit | 34a048f7daaf93b16ae4121bf5238f9008f3465b (patch) | |
| tree | 3857fdc80f73522a8b2af265f257a4decd447afd /src/check_builtin.cpp | |
| parent | ffe953b43d1ad31d2c37f544a1d389e30d8f69bf (diff) | |
Replace compiler for loops for the hash-table types to simplify code usage
Diffstat (limited to 'src/check_builtin.cpp')
| -rw-r--r-- | src/check_builtin.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp index 809d1d9a5..533929200 100644 --- a/src/check_builtin.cpp +++ b/src/check_builtin.cpp @@ -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; |