Commit: b7718bbdf55c1a217a5224093ebb59b9a39135f6
Author: Manuel Castilla
Date:   Sun Sep 5 14:25:14 2021 +0200
Branches: master
https://developer.blender.org/rBb7718bbdf55c1a217a5224093ebb59b9a39135f6

Cleanup: improve code clarity

Addresses D12341 review.

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

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

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

diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.cc 
b/source/blender/compositor/intern/COM_NodeOperationBuilder.cc
index 5e18b5396b1..b2cd76be2c3 100644
--- a/source/blender/compositor/intern/COM_NodeOperationBuilder.cc
+++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.cc
@@ -477,15 +477,15 @@ static Vector<NodeOperationHash> 
generate_hashes(Span<NodeOperation *> operation
 /** Merge operations with same type, inputs and parameters that produce the 
same result. */
 void NodeOperationBuilder::merge_equal_operations()
 {
-  bool any_merged = true;
-  while (any_merged) {
+  bool check_for_next_merge = true;
+  while (check_for_next_merge) {
     /* Re-generate hashes with any change. */
     Vector<NodeOperationHash> hashes = generate_hashes(m_operations);
 
     /* Make hashes be consecutive when they are equal. */
     std::sort(hashes.begin(), hashes.end());
 
-    any_merged = false;
+    bool any_merged = false;
     const NodeOperationHash *prev_hash = nullptr;
     for (const NodeOperationHash &hash : hashes) {
       if (prev_hash && *prev_hash == hash) {
@@ -494,6 +494,8 @@ void NodeOperationBuilder::merge_equal_operations()
       }
       prev_hash = &hash;
     }
+
+    check_for_next_merge = any_merged;
   }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to