pnoltes commented on code in PR #470:
URL: https://github.com/apache/celix/pull/470#discussion_r1390439644
##########
libs/utils/src/celix_hash_map.c:
##########
@@ -599,33 +675,49 @@ bool celix_longHashMapIterator_isEnd(const
celix_long_hash_map_iterator_t* iter)
void celix_stringHashMapIterator_next(celix_string_hash_map_iterator_t* iter) {
const celix_hash_map_t* map = iter->_internal[0];
celix_hash_map_entry_t *entry = iter->_internal[1];
+ iter->index += 1;
entry = celix_hashMap_nextEntry(map, entry);
- if (entry != NULL) {
+ if (entry) {
iter->_internal[1] = entry;
- iter->index += 1;
iter->key = entry->key.strKey;
iter->value = entry->value;
} else {
- memset(iter, 0, sizeof(*iter));
- iter->_internal[0] = (void*)map;
+ iter->_internal[1] = NULL;
+ iter->key = NULL;
Review Comment:
nice catch, this should be aligned. Updated the next so that the key is set
to `""`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]