g_assert (obj != NULL);
g_assert (sec->handler != NULL);
- it = ucl_object_iterate_new (obj);
+ it = NULL;
if (sec->key_attr != NULL) {
- while ((cur = ucl_object_iterate_safe (it, false)) != NULL) {
+ while ((cur = ucl_iterate_object (obj, &it, true)) != NULL) {
if (ucl_object_type (cur) != UCL_OBJECT) {
is_nested = FALSE;
break;
is_nested = FALSE;
}
- ucl_object_iterate_free (it);
-
if (is_nested) {
/* Just reiterate on all subobjects */
- it = ucl_object_iterate_new (obj);
+ it = NULL;
- while ((cur = ucl_object_iterate_safe (it, false)) != NULL) {
+ while ((cur = ucl_iterate_object (obj, &it, true)) != NULL) {
if (!sec->handler (pool, cur, ucl_object_key (cur), ptr, sec, err)) {
- ucl_object_iterate_free (it);
return FALSE;
}
}
- ucl_object_iterate_free (it);
return TRUE;
}
else {