Partially revert "Cleanup: use post increment/decrement"

This partially reverts commit 0b2d1badec

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.
This commit is contained in:
2019-09-08 03:31:49 +10:00
parent abeab4fcad
commit fd05f01be6
16 changed files with 76 additions and 76 deletions

View File

@@ -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;