Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Castilla <manzanillawork@gmail.com>2021-09-05 15:25:14 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-09-05 15:25:14 +0300
commitb7718bbdf55c1a217a5224093ebb59b9a39135f6 (patch)
tree14adc08771e0293f7db3c7063c43bd0da80f29e1 /source/blender/compositor
parent079bd115563640b81cccba645d15b6b55efd3b8e (diff)
Cleanup: improve code clarity
Addresses D12341 review.
Diffstat (limited to 'source/blender/compositor')
-rw-r--r--source/blender/compositor/intern/COM_NodeOperationBuilder.cc8
1 files changed, 5 insertions, 3 deletions
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;
}
}