diff options
author | Bastien Montagne <bastien@blender.org> | 2020-07-21 13:17:22 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-07-21 13:18:08 +0300 |
commit | 494a6a0bf2c9141251d7dbae9dc51acd42ebc702 (patch) | |
tree | ea865416ab1f034ff8270ea676a45a3804da1375 /source/blender/blenkernel | |
parent | 629726177a20e196dbfda9867281bbdb365b699b (diff) |
Cleanup: `layer_collection_sync`: use `LISTBASE_FOREACH_MUTABLE`.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 5bedc86f25d..64649d84320 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -708,9 +708,8 @@ static void layer_collection_sync(ViewLayer *view_layer, * linking we can only sync after the fact. */ /* Remove layer collections that no longer have a corresponding scene collection. */ - for (LayerCollection *lc = lb_layer_collections->first; lc;) { - /* Note ID remap can set lc->collection to NULL when deleting collections. */ - LayerCollection *lc_next = lc->next; + LISTBASE_FOREACH_MUTABLE (LayerCollection *, lc, lb_layer_collections) { + /* Note that ID remap can set lc->collection to NULL when deleting collections. */ Collection *collection = (lc->collection) ? BLI_findptr(lb_collections, lc->collection, @@ -726,8 +725,6 @@ static void layer_collection_sync(ViewLayer *view_layer, layer_collection_free(view_layer, lc); BLI_freelinkN(lb_layer_collections, lc); } - - lc = lc_next; } /* Add layer collections for any new scene collections, and ensure order is the same. */ |