[Bf-blender-cvs] [0efca18df70] master: Cleanup: Modernize iter.

Jeroen Bakker noreply at git.blender.org
Tue Mar 16 15:08:37 CET 2021


Commit: 0efca18df701244f1e5c2f43ebc0cfba86055478
Author: Jeroen Bakker
Date:   Tue Mar 16 13:45:26 2021 +0100
Branches: master
https://developer.blender.org/rB0efca18df701244f1e5c2f43ebc0cfba86055478

Cleanup: Modernize iter.

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

M	source/blender/compositor/intern/COM_Debug.cc

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

diff --git a/source/blender/compositor/intern/COM_Debug.cc b/source/blender/compositor/intern/COM_Debug.cc
index 722d544a362..c97d3a4a00a 100644
--- a/source/blender/compositor/intern/COM_Debug.cc
+++ b/source/blender/compositor/intern/COM_Debug.cc
@@ -314,14 +314,11 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
   len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "rankdir=LR\r\n");
   len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "splines=false\r\n");
 
-  int totops = system->m_operations.size();
-  int totgroups = system->m_groups.size();
   std::map<NodeOperation *, std::vector<std::string>> op_groups;
-  for (int i = 0; i < totgroups; i++) {
-    const ExecutionGroup *group = system->m_groups[i];
-
-    len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// GROUP: %d\r\n", i);
-    len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "subgraph cluster_%d{\r\n", i);
+  int index = 0;
+  for (const ExecutionGroup *group : system->m_groups) {
+    len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// GROUP: %d\r\n", index);
+    len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "subgraph cluster_%d{\r\n", index);
     /* used as a check for executing group */
     if (m_group_states[group] == EG_WAIT) {
       len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "style=dashed\r\n");
@@ -346,18 +343,12 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
           system, operation, group, str + len, maxlen > len ? maxlen - len : 0);
     }
 
-    // len += snprintf(str+len,
-    //     maxlen>len ? maxlen-len : 0,
-    //     "//  OUTPUTOPERATION: %p\r\n", group->getOutputOperation());
-    // len += snprintf(
-    //     str+len, maxlen>len ? maxlen-len : 0,
-    //     " O_%p\r\n", group->getOutputOperation());
     len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "}\r\n");
+    index++;
   }
 
   /* operations not included in any group */
-  for (int j = 0; j < totops; j++) {
-    NodeOperation *operation = system->m_operations[j];
+  for (NodeOperation *operation : system->m_operations) {
     if (op_groups.find(operation) != op_groups.end()) {
       continue;
     }
@@ -368,9 +359,7 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
         system, operation, nullptr, str + len, maxlen > len ? maxlen - len : 0);
   }
 
-  for (int i = 0; i < totops; i++) {
-    NodeOperation *operation = system->m_operations[i];
-
+  for (NodeOperation *operation : system->m_operations) {
     if (operation->isReadBufferOperation()) {
       ReadBufferOperation *read = (ReadBufferOperation *)operation;
       WriteBufferOperation *write = read->getMemoryProxy()->getWriteBufferOperation();
@@ -391,12 +380,8 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
     }
   }
 
-  for (int i = 0; i < totops; i++) {
-    NodeOperation *op = system->m_operations[i];
-
-    for (NodeOperation::Inputs::const_iterator it = op->m_inputs.begin(); it != op->m_inputs.end();
-         ++it) {
-      NodeOperationInput *to = *it;
+  for (NodeOperation *op : system->m_operations) {
+    for (NodeOperationInput *to : op->m_inputs) {
       NodeOperationOutput *from = to->getLink();
 
       if (!from) {



More information about the Bf-blender-cvs mailing list