# HG changeset patch # User Mike Becker # Date 1755551336 -7200 # Node ID 79a865252b161ab8ca7dece56424da0231d08ba9 # Parent 8afaeb395b3cc9dc3bb1641eb3a53bc5390bc917 fix that the support for NULL when creating mutating iterators was broken diff -r 8afaeb395b3c -r 79a865252b16 src/list.c --- a/src/list.c Mon Aug 18 23:06:27 2025 +0200 +++ b/src/list.c Mon Aug 18 23:08:56 2025 +0200 @@ -476,6 +476,7 @@ CxList *list, size_t index ) { + if (list == NULL) list = cxEmptyList; CxIterator it = list->cl->iterator(list, index, false); it.base.mutating = true; return it; @@ -485,6 +486,7 @@ CxList *list, size_t index ) { + if (list == NULL) list = cxEmptyList; CxIterator it = list->cl->iterator(list, index, true); it.base.mutating = true; return it; diff -r 8afaeb395b3c -r 79a865252b16 src/map.c --- a/src/map.c Mon Aug 18 23:06:27 2025 +0200 +++ b/src/map.c Mon Aug 18 23:08:56 2025 +0200 @@ -85,18 +85,21 @@ // CxMapIterator cxMapMutIteratorValues(CxMap *map) { + if (map == NULL) map = cxEmptyMap; CxMapIterator it = map->cl->iterator(map, CX_MAP_ITERATOR_VALUES); it.base.mutating = true; return it; } CxMapIterator cxMapMutIteratorKeys(CxMap *map) { + if (map == NULL) map = cxEmptyMap; CxMapIterator it = map->cl->iterator(map, CX_MAP_ITERATOR_KEYS); it.base.mutating = true; return it; } CxMapIterator cxMapMutIterator(CxMap *map) { + if (map == NULL) map = cxEmptyMap; CxMapIterator it = map->cl->iterator(map, CX_MAP_ITERATOR_PAIRS); it.base.mutating = true; return it;