From fd05f01be60128e70b7e53d566627c9e84b6a98d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 8 Sep 2019 03:31:49 +1000 Subject: Partially revert "Cleanup: use post increment/decrement" This partially reverts commit 0b2d1badecc48b5cbff5ec088b29c6e9acc5e1d0 Post increment can deep-copy for C++ iterators, while in my own checks GCC was able to optimize this to get the same output, better follow C++ best practice and use pre-increment for iterators. --- source/blender/compositor/intern/COM_NodeGraph.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/compositor/intern/COM_NodeGraph.cpp') diff --git a/source/blender/compositor/intern/COM_NodeGraph.cpp b/source/blender/compositor/intern/COM_NodeGraph.cpp index ce54aef946b..b4d6cc0ff60 100644 --- a/source/blender/compositor/intern/COM_NodeGraph.cpp +++ b/source/blender/compositor/intern/COM_NodeGraph.cpp @@ -160,7 +160,7 @@ void NodeGraph::add_bNode(const CompositorContext &context, NodeGraph::NodeInputs NodeGraph::find_inputs(const NodeRange &node_range, bNodeSocket *b_socket) { NodeInputs result; - for (NodeGraph::NodeIterator it = node_range.first; it != node_range.second; it++) { + for (NodeGraph::NodeIterator it = node_range.first; it != node_range.second; ++it) { Node *node = *it; for (int index = 0; index < node->getNumberOfInputSockets(); index++) { NodeInput *input = node->getInputSocket(index); @@ -174,7 +174,7 @@ NodeGraph::NodeInputs NodeGraph::find_inputs(const NodeRange &node_range, bNodeS NodeOutput *NodeGraph::find_output(const NodeRange &node_range, bNodeSocket *b_socket) { - for (NodeGraph::NodeIterator it = node_range.first; it != node_range.second; it++) { + for (NodeGraph::NodeIterator it = node_range.first; it != node_range.second; ++it) { Node *node = *it; for (int index = 0; index < node->getNumberOfOutputSockets(); index++) { NodeOutput *output = node->getOutputSocket(index); @@ -206,7 +206,7 @@ void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink } NodeInputs inputs = find_inputs(node_range, b_nodelink->tosock); - for (NodeInputs::const_iterator it = inputs.begin(); it != inputs.end(); it++) { + for (NodeInputs::const_iterator it = inputs.begin(); it != inputs.end(); ++it) { NodeInput *input = *it; if (input->isLinked()) { continue; -- cgit v1.2.3