[Bf-blender-cvs] [272b9d2d1b0] temp-sybren-usd-patch-01: USD: rename `link` to `dupli_object` and made variable loop-local

Sybren A. Stüvel noreply at git.blender.org
Tue Nov 26 18:22:41 CET 2019


Commit: 272b9d2d1b09b6442477ba5bb479f7f6f76e5833
Author: Sybren A. Stüvel
Date:   Tue Nov 26 13:51:09 2019 +0100
Branches: temp-sybren-usd-patch-01
https://developer.blender.org/rB272b9d2d1b09b6442477ba5bb479f7f6f76e5833

USD: rename `link` to `dupli_object` and made variable loop-local

I added an explicit `!= nullptr` to make the formatter put the three parts
of the `for`-statement on three different lines (instead of two), which
increases readability.

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

M	source/blender/usd/intern/abstract_hierarchy_iterator.cc

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

diff --git a/source/blender/usd/intern/abstract_hierarchy_iterator.cc b/source/blender/usd/intern/abstract_hierarchy_iterator.cc
index d9a23f33aae..4215264c9a0 100644
--- a/source/blender/usd/intern/abstract_hierarchy_iterator.cc
+++ b/source/blender/usd/intern/abstract_hierarchy_iterator.cc
@@ -188,24 +188,26 @@ void AbstractHierarchyIterator::export_graph_construct()
     // Export the duplicated objects instanced by this object.
     ListBase *lb = object_duplilist(depsgraph_, scene, object);
     if (lb) {
-      DupliObject *link = nullptr;
-
       // Construct the set of duplicated objects, so that later we can determine whether a parent
       // is also duplicated itself.
       std::set<Object *> dupli_set;
-      for (link = static_cast<DupliObject *>(lb->first); link; link = link->next) {
-        if (!should_visit_dupli_object(link)) {
+      for (DupliObject *dupli_object = static_cast<DupliObject *>(lb->first);
+           dupli_object != nullptr;
+           dupli_object = dupli_object->next) {
+        if (!should_visit_dupli_object(dupli_object)) {
           continue;
         }
-        dupli_set.insert(link->ob);
+        dupli_set.insert(dupli_object->ob);
       }
 
-      for (link = static_cast<DupliObject *>(lb->first); link; link = link->next) {
-        if (!should_visit_dupli_object(link)) {
+      for (DupliObject *dupli_object = static_cast<DupliObject *>(lb->first);
+           dupli_object != nullptr;
+           dupli_object = dupli_object->next) {
+        if (!should_visit_dupli_object(dupli_object)) {
           continue;
         }
 
-        visit_dupli_object(link, object, dupli_set);
+        visit_dupli_object(dupli_object, object, dupli_set);
       }
     }



More information about the Bf-blender-cvs mailing list