diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-03-26 17:56:27 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-03-26 18:02:59 +0300 |
commit | 2371454b2da4eab159315b3f1da6b683af9dbe04 (patch) | |
tree | e5466ec312ec0e4dd1b07f5c17fa5e8577b3bd58 /source/blender/compositor | |
parent | 6524ceb8cfa53e2209b73023cfa16d1b58b1247e (diff) |
Cleanup: Replace Methode Overloading With Default Value.
Diffstat (limited to 'source/blender/compositor')
-rw-r--r-- | source/blender/compositor/intern/COM_NodeOperation.cc | 23 | ||||
-rw-r--r-- | source/blender/compositor/intern/COM_NodeOperation.h | 6 |
2 files changed, 8 insertions, 21 deletions
diff --git a/source/blender/compositor/intern/COM_NodeOperation.cc b/source/blender/compositor/intern/COM_NodeOperation.cc index e68c53bd7b2..a8559b76d21 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cc +++ b/source/blender/compositor/intern/COM_NodeOperation.cc @@ -62,27 +62,18 @@ void NodeOperation::addOutputSocket(DataType datatype) void NodeOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { - unsigned int temp[2]; - unsigned int temp2[2]; + NodeOperationInput &input = m_inputs[m_resolutionInputSocketIndex]; + input.determineResolution(resolution, preferredResolution); + unsigned int temp2[2] = {resolution[0], resolution[1]}; - // TODO(jbakker): Replace for loops with direct array access. + unsigned int temp[2]; for (unsigned int index = 0; index < m_inputs.size(); index++) { - NodeOperationInput &input = m_inputs[index]; - if (input.isConnected()) { - if (index == this->m_resolutionInputSocketIndex) { - input.determineResolution(resolution, preferredResolution); - temp2[0] = resolution[0]; - temp2[1] = resolution[1]; - break; - } + if (index == this->m_resolutionInputSocketIndex) { + continue; } - } - for (unsigned int index = 0; index < m_inputs.size(); index++) { NodeOperationInput &input = m_inputs[index]; if (input.isConnected()) { - if (index != this->m_resolutionInputSocketIndex) { - input.determineResolution(temp, temp2); - } + input.determineResolution(temp, temp2); } } } diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h index 5b9375ae531..b06a453a775 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.h +++ b/source/blender/compositor/intern/COM_NodeOperation.h @@ -238,11 +238,7 @@ class NodeOperation { { return m_outputs.size(); } - NodeOperationOutput *getOutputSocket(unsigned int index); - NodeOperationOutput *getOutputSocket() - { - return getOutputSocket(0); - } + NodeOperationOutput *getOutputSocket(unsigned int index = 0); NodeOperationInput *getInputSocket(unsigned int index); /** Check if this is an input operation |