fx.collections: update iterator semantics

This commit is contained in:
2026-05-28 20:52:40 +01:00
parent 883b0b24b1
commit ff0d40b324
8 changed files with 143 additions and 116 deletions
+5 -5
View File
@@ -19,13 +19,13 @@ int main(void)
printf("no value\n");
}
fx_iterator *it = fx_hashtable_begin(ht);
const fx_iterator *it = fx_hashtable_begin(ht);
fx_foreach(val, it)
{
fx_hashtable_item *item = NULL;
fx_value_get_object(&val, &item);
fx_value_get_object(val, &item);
printf("item %p\n", item);
fx_value key, value;
const fx_value *key, *value;
key = fx_hashtable_item_get_key(item);
value = fx_hashtable_item_get_value(item);
@@ -34,10 +34,10 @@ int main(void)
fx_foreach(prop_val, prop_it)
{
fx_property *prop;
fx_value_get_object(&prop_val, &prop);
fx_value_get_object(prop_val, &prop);
printf("%s = ", fx_property_get_name(prop));
fx_value value = FX_VALUE_EMPTY;
fx_property_get_value(prop, &val, &value);
fx_property_get_value(prop, val, &value);
fx_value_to_string(&value, fx_stdout, NULL);
printf("\n");
}