From 34a048f7daaf93b16ae4121bf5238f9008f3465b Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 9 Dec 2022 11:29:28 +0000 Subject: Replace compiler for loops for the hash-table types to simplify code usage --- src/query_data.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/query_data.cpp') 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(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(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 -- cgit v1.2.3