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
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-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;
}
}