Sat, 27 Sep 2025 17:03:35 +0200
simplify hash map iterator - resolves #727
src/hash_map.c | file | annotate | diff | comparison | revisions |
--- a/src/hash_map.c Fri Sep 26 22:43:17 2025 +0200 +++ b/src/hash_map.c Sat Sep 27 17:03:35 2025 +0200 @@ -269,19 +269,12 @@ static void *cx_hash_map_iter_current_key(const void *it) { const CxMapIterator *iter = it; - struct cx_hash_map_element_s *elm = iter->elem; - return &elm->key; + return (void*) iter->entry.key; } static void *cx_hash_map_iter_current_value(const void *it) { const CxMapIterator *iter = it; - const CxMap *map = iter->map.c; - struct cx_hash_map_element_s *elm = iter->elem; - if (map->collection.store_pointer) { - return *(void **) elm->data; - } else { - return elm->data; - } + return iter->entry.value; } static bool cx_hash_map_iter_valid(const void *it) {