[Bf-blender-cvs] [4f140ec7cc0] master: Cleanup: Use LISTBASE_FOREACH macro

Hans Goudey noreply at git.blender.org
Fri Nov 6 05:39:37 CET 2020


Commit: 4f140ec7cc08e52eddae36f31bd7278506140679
Author: Hans Goudey
Date:   Thu Nov 5 22:39:30 2020 -0600
Branches: master
https://developer.blender.org/rB4f140ec7cc08e52eddae36f31bd7278506140679

Cleanup: Use LISTBASE_FOREACH macro

===================================================================

M	source/blender/blenkernel/intern/layer.c

===================================================================

diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 5b88a68b921..4915ad4eaac 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -1450,12 +1450,9 @@ static LayerCollection *find_layer_collection_by_scene_collection(LayerCollectio
 LayerCollection *BKE_layer_collection_first_from_scene_collection(ViewLayer *view_layer,
                                                                   const Collection *collection)
 {
-  for (LayerCollection *layer_collection = view_layer->layer_collections.first;
-       layer_collection != NULL;
-       layer_collection = layer_collection->next) {
+  LISTBASE_FOREACH (LayerCollection *, layer_collection, &view_layer->layer_collections) {
     LayerCollection *found = find_layer_collection_by_scene_collection(layer_collection,
                                                                        collection);
-
     if (found != NULL) {
       return found;
     }
@@ -1900,9 +1897,7 @@ void BKE_view_layer_blend_read_lib(BlendLibReader *reader, Library *lib, ViewLay
     BLO_read_id_address(reader, lib, &fls->group);
   }
 
-  for (Base *base = view_layer->object_bases.first, *base_next = NULL; base; base = base_next) {
-    base_next = base->next;
-
+  LISTBASE_FOREACH_MUTABLE (Base *, base, &view_layer->object_bases) {
     /* we only bump the use count for the collection objects */
     BLO_read_id_address(reader, lib, &base->object);



More information about the Bf-blender-cvs mailing list