diff options
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 7d265b8fd02..f0ae3d8be1c 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -584,18 +584,14 @@ void BKE_scene_objects_iterator_begin(BLI_Iterator *iter, void *data_in) */ static LinkData *object_base_unique(GSet *gs, LinkData *link) { - if (link == NULL) { - return NULL; - } - - Object *ob = link->data; - if (!BLI_gset_haskey(gs, ob)) { - BLI_gset_add(gs, ob); - return link; - } - else { - return object_base_unique(gs, link->next); + for (; link != NULL; link = link->next) { + Object *ob = link->data; + if (!BLI_gset_haskey(gs, ob)) { + BLI_gset_add(gs, ob); + return link; + } } + return NULL; } void BKE_scene_objects_iterator_next(BLI_Iterator *iter) |