From 3d4a844a50744815d234c96dd72af675f478dbe1 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Fri, 5 Mar 2021 15:25:05 +0100 Subject: Cleanup: ExecutionSystem::find_output_execution_groups. --- .../compositor/intern/COM_ExecutionSystem.cpp | 29 ++++++++++------------ .../compositor/intern/COM_ExecutionSystem.h | 6 ++--- 2 files changed, 16 insertions(+), 19 deletions(-) (limited to 'source') diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp index 3da2523bfdb..9d6359e9cb3 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp @@ -179,10 +179,10 @@ void ExecutionSystem::execute() WorkScheduler::start(this->m_context); - executeGroups(COM_PRIORITY_HIGH); + execute_groups(COM_PRIORITY_HIGH); if (!this->getContext().isFastCalculation()) { - executeGroups(COM_PRIORITY_MEDIUM); - executeGroups(COM_PRIORITY_LOW); + execute_groups(COM_PRIORITY_MEDIUM); + execute_groups(COM_PRIORITY_LOW); } WorkScheduler::finish(); @@ -199,26 +199,23 @@ void ExecutionSystem::execute() } } -void ExecutionSystem::executeGroups(CompositorPriority priority) +void ExecutionSystem::execute_groups(CompositorPriority priority) { - unsigned int index; - std::vector executionGroups; - this->findOutputExecutionGroup(&executionGroups, priority); - - for (index = 0; index < executionGroups.size(); index++) { - ExecutionGroup *group = executionGroups[index]; + blender::Vector execution_groups = find_output_execution_groups(priority); + for (ExecutionGroup *group : execution_groups) { group->execute(this); } } -void ExecutionSystem::findOutputExecutionGroup(std::vector *result, - CompositorPriority priority) const +blender::Vector ExecutionSystem::find_output_execution_groups( + CompositorPriority priority) const { - unsigned int index; - for (index = 0; index < this->m_groups.size(); index++) { - ExecutionGroup *group = this->m_groups[index]; + blender::Vector result; + + for (ExecutionGroup *group : m_groups) { if (group->isOutputExecutionGroup() && group->getRenderPriotrity() == priority) { - result->push_back(group); + result.append(group); } } + return result; } diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.h b/source/blender/compositor/intern/COM_ExecutionSystem.h index 8b69caf106f..dd68edd4793 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.h +++ b/source/blender/compositor/intern/COM_ExecutionSystem.h @@ -137,8 +137,8 @@ class ExecutionSystem { /** * find all execution group with output nodes */ - void findOutputExecutionGroup(std::vector *result, - CompositorPriority priority) const; + blender::Vector find_output_execution_groups( + CompositorPriority priority) const; public: /** @@ -181,7 +181,7 @@ class ExecutionSystem { } private: - void executeGroups(CompositorPriority priority); + void execute_groups(CompositorPriority priority); /* allow the DebugInfo class to look at internals */ friend class DebugInfo; -- cgit v1.2.3