ds: dict: fix iterable_begin not setting iterator status

This commit is contained in:
2025-11-01 10:00:57 +00:00
parent 493b9ec4a4
commit 734c80c527

View File

@@ -495,6 +495,7 @@ static b_iterator *iterable_begin(b_dict *dict)
if (dict_is_empty(it->_d_p)) { if (dict_is_empty(it->_d_p)) {
it->item.key = NULL; it->item.key = NULL;
it->item.value = NULL; it->item.value = NULL;
b_iterator_set_status(it_obj, B_ERR_NO_DATA);
return it_obj; return it_obj;
} }
@@ -504,6 +505,7 @@ static b_iterator *iterable_begin(b_dict *dict)
if (!first_bucket) { if (!first_bucket) {
it->item.key = NULL; it->item.key = NULL;
it->item.value = NULL; it->item.value = NULL;
b_iterator_set_status(it_obj, B_ERR_NO_DATA);
return it_obj; return it_obj;
} }
@@ -513,6 +515,7 @@ static b_iterator *iterable_begin(b_dict *dict)
if (!first_item) { if (!first_item) {
it->item.key = NULL; it->item.key = NULL;
it->item.value = NULL; it->item.value = NULL;
b_iterator_set_status(it_obj, B_ERR_NO_DATA);
return it_obj; return it_obj;
} }