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/build_settings.cpp | |
| parent | ffe953b43d1ad31d2c37f544a1d389e30d8f69bf (diff) | |
Replace compiler for loops for the hash-table types to simplify code usage
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 1cd2899c4..ba68e388b 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -1328,23 +1328,26 @@ void enable_target_feature(TokenPos pos, String const &target_feature_list) { char const *target_features_set_to_cstring(gbAllocator allocator, bool with_quotes) { isize len = 0; - for_array(i, build_context.target_features_set.entries) { + isize i = 0; + for (auto const &entry : build_context.target_features_set) { if (i != 0) { len += 1; } - String feature = build_context.target_features_set.entries[i].value; + String feature = entry.value; len += feature.len; if (with_quotes) len += 2; + i += 1; } char *features = gb_alloc_array(allocator, char, len+1); len = 0; - for_array(i, build_context.target_features_set.entries) { + i = 0; + for (auto const &entry : build_context.target_features_set) { if (i != 0) { features[len++] = ','; } if (with_quotes) features[len++] = '"'; - String feature = build_context.target_features_set.entries[i].value; + String feature = entry.value; gb_memmove(features + len, feature.text, feature.len); len += feature.len; if (with_quotes) features[len++] = '"'; |