mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-22 21:54:59 -07:00
Allow all set entry types to be implicitly cast to their key/value type to allow for easier iteration
This commit is contained in:
@@ -1332,11 +1332,10 @@ gb_internal void enable_target_feature(TokenPos pos, String const &target_featur
|
||||
gb_internal char const *target_features_set_to_cstring(gbAllocator allocator, bool with_quotes) {
|
||||
isize len = 0;
|
||||
isize i = 0;
|
||||
for (auto const &entry : build_context.target_features_set) {
|
||||
for (String const &feature : build_context.target_features_set) {
|
||||
if (i != 0) {
|
||||
len += 1;
|
||||
}
|
||||
String feature = entry.value;
|
||||
len += feature.len;
|
||||
if (with_quotes) len += 2;
|
||||
i += 1;
|
||||
@@ -1344,13 +1343,12 @@ gb_internal char const *target_features_set_to_cstring(gbAllocator allocator, bo
|
||||
char *features = gb_alloc_array(allocator, char, len+1);
|
||||
len = 0;
|
||||
i = 0;
|
||||
for (auto const &entry : build_context.target_features_set) {
|
||||
for (String const &feature : build_context.target_features_set) {
|
||||
if (i != 0) {
|
||||
features[len++] = ',';
|
||||
}
|
||||
|
||||
if (with_quotes) features[len++] = '"';
|
||||
String feature = entry.value;
|
||||
gb_memmove(features + len, feature.text, feature.len);
|
||||
len += feature.len;
|
||||
if (with_quotes) features[len++] = '"';
|
||||
|
||||
Reference in New Issue
Block a user