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/query_data.cpp | |
| parent | ffe953b43d1ad31d2c37f544a1d389e30d8f69bf (diff) | |
Replace compiler for loops for the hash-table types to simplify code usage
Diffstat (limited to 'src/query_data.cpp')
| -rw-r--r-- | src/query_data.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/query_data.cpp b/src/query_data.cpp index 71c21f2ba..ebf955fd4 100644 --- a/src/query_data.cpp +++ b/src/query_data.cpp @@ -449,8 +449,8 @@ void generate_and_print_query_data_global_definitions(Checker *c, Timings *timin auto sorted_packages = array_make<AstPackage *>(query_value_allocator, 0, c->info.packages.entries.count); defer (array_free(&sorted_packages)); - 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 != nullptr) { array_add(&sorted_packages, pkg); } @@ -880,8 +880,8 @@ void generate_and_print_query_data_go_to_definitions(Checker *c) { isize file_path_memory_needed = 0; auto files = array_make<GoToDefFileMap>(a, 0, c->info.files.entries.count); - for_array(i, c->info.files.entries) { - AstFile *f = c->info.files.entries[i].value; + for (auto const &entry : c->info.files) { + AstFile *f = entry.value; file_path_memory_needed += f->fullpath.len+1; // add NUL terminator |