diff options
| author | gingerBill <bill@gingerbill.org> | 2023-01-30 12:53:36 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-01-30 12:53:36 +0000 |
| commit | 88b578ca11a9042e1e35a4ab272f18debe6c7a79 (patch) | |
| tree | a6ecd0e9daf1727f8e3c66aa03998acc258fc0e1 /src/build_settings.cpp | |
| parent | 4cb16db4e91432cf90b5bf94678a0eb0eef0273d (diff) | |
Add for C++ for loop uses
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 904428602..d18ca5603 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -596,9 +596,9 @@ gb_internal void add_library_collection(String name, String path) { } gb_internal bool find_library_collection_path(String name, String *path) { - for_array(i, library_collections) { - if (library_collections[i].name == name) { - if (path) *path = library_collections[i].path; + for (auto const &lc : library_collections) { + if (lc.name == name) { + if (path) *path = lc.path; return true; } } @@ -1307,8 +1307,7 @@ gb_internal bool check_target_feature_is_enabled(TokenPos pos, String const &tar auto items = split_by_comma(target_feature_list); array_free(&items); - for_array(i, items) { - String const &item = items.data[i]; + for (String const &item : items) { if (!check_target_feature_is_valid(pos, item)) { error(pos, "Target feature '%.*s' is not valid", LIT(item)); return false; @@ -1328,8 +1327,7 @@ gb_internal void enable_target_feature(TokenPos pos, String const &target_featur defer (mutex_unlock(&bc->target_features_mutex)); auto items = split_by_comma(target_feature_list); - for_array(i, items) { - String const &item = items.data[i]; + for (String const &item : items) { if (!check_target_feature_is_valid(pos, item)) { error(pos, "Target feature '%.*s' is not valid", LIT(item)); continue; |