Depsgraph: Cleanup, make conditions more clear and less indented
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 8 Jun 2018 09:25:00 +0000 (11:25 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 8 Jun 2018 09:57:16 +0000 (11:57 +0200)
source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc

index 3fc97ee..7f44356 100644 (file)
@@ -71,13 +71,13 @@ void DepsgraphNodeBuilder::build_layer_collections(ListBase *lb)
                COLLECTION_RESTRICT_VIEW : COLLECTION_RESTRICT_RENDER;
 
        for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) {
-               if (!(lc->collection->flag & restrict_flag)) {
-                       if (!(lc->flag & LAYER_COLLECTION_EXCLUDE)) {
-                               build_collection(lc->collection);
-                       }
-
-                       build_layer_collections(&lc->layer_collections);
+               if (lc->collection->flag & restrict_flag) {
+                       continue;
+               }
+               if ((lc->flag & LAYER_COLLECTION_EXCLUDE) == 0) {
+                       build_collection(lc->collection);
                }
+               build_layer_collections(&lc->layer_collections);
        }
 }