dict_ref & dict_cref returns a pointer to struct pair_s instead of pair_t (which

is an array of struct pair_s).
This will break API compatibility. However:
it makes the user code cleaner as a level of indirection is removed.
it uniformizes with the OA dict version
This commit is contained in:
Patrick Pelissier committed 2017-10-18 23:25:39 +02:00
1 parent 8265ccbb42
commit 8914d336a0
7 files changed
+32 -33

No files matched your search

+2 -2
View File
@@ -42,9 +42,9 @@ int main(void)
dict_str_it_t it;
for(dict_str_it(it, h); !dict_str_end_p(it); dict_str_next(it)) {
// Get a constant reference on the pair stored in the dictionnary
const dict_str_pair_t *pair = dict_str_cref(it);
const struct dict_str_pair_s *pair = dict_str_cref(it);
printf ("Key=%s Value=%d\n",
string_get_cstr((*pair)->key), (*pair)->value);
string_get_cstr(pair->key), pair->value);
}
// Clear variables