pnoltes commented on code in PR #470: URL: https://github.com/apache/celix/pull/470#discussion_r1390437669
########## 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; Review Comment: I designed the hashmap/properties iterator based on C++ iterator with begin() and end(). For C++ the `end()` iterator is past the last element. So IMO it is correct that the index of the end iterator is the same as the size of the map. ########## libs/utils/src/celix_hash_map.c: ########## @@ -256,57 +255,46 @@ static bool celix_hashMap_putValue(celix_hash_map_t* map, const char* strKey, lo if (replacedValueOut != NULL) { *replacedValueOut = entry->value; } + celix_hashMap_callRemovedCallback(map, entry); memcpy(&entry->value, value, sizeof(*value)); - return true; + return CELIX_SUCCESS; } } - celix_hashMap_addEntry(map, hash, &key, value, index); - if (replacedValueOut != NULL) { + celix_status_t status = celix_hashMap_addEntry(map, hash, &key, value, index); + if (status == CELIX_SUCCESS && replacedValueOut != NULL) { memset(replacedValueOut, 0, sizeof(*replacedValueOut)); } - return false; + return status; } -static void* celix_hashMap_put(celix_hash_map_t* map, const char* strKey, long longKey, void* v) { +static celix_status_t celix_hashMap_put(celix_hash_map_t* map, const char* strKey, long longKey, void* v, void** previousValueOut) { Review Comment: removed -- 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: dev-unsubscr...@celix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org