diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-09-05 15:25:14 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-09-05 15:25:14 +0300 |
commit | b7718bbdf55c1a217a5224093ebb59b9a39135f6 (patch) | |
tree | 14adc08771e0293f7db3c7063c43bd0da80f29e1 /source/blender | |
parent | 079bd115563640b81cccba645d15b6b55efd3b8e (diff) |
Cleanup: improve code clarity
Addresses D12341 review.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/compositor/intern/COM_NodeOperationBuilder.cc | 8 |
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; } } |