pseudomap: dont crash on destroy if map is null

the previous contract for orderedlist was that orderedmap_destroy()
can be called with a NULL pointer.
This commit is contained in:
rofl0r 2022-05-23 20:17:25 +00:00
parent 2508c1a5e6
commit 78e4a6d902

View File

@ -28,6 +28,7 @@ pseudomap *pseudomap_create(void) {
}
void pseudomap_destroy(pseudomap *o) {
if(!o) return;
while(sblist_getsize(o)) {
/* retrieve latest element, and "shrink" list in place,
so we don't have to constantly rearrange list items