Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2021-03-26 13:55:13 +0300
committerJeroen Bakker <jeroen@blender.org>2021-03-26 17:51:06 +0300
commit23b1872d6e45fd40aaf5040c1553bfbd524e0a11 (patch)
treeb3d910ae8e488bd55c927f2f12bf8251de31ac39 /source/blender/compositor/intern
parentacc6e5c315a508f7ca7896b08354067c0fb44067 (diff)
Cleanup: Replace std::vector with blender::Vector.
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r--source/blender/compositor/intern/COM_NodeGraph.cc6
-rw-r--r--source/blender/compositor/intern/COM_NodeGraph.h11
-rw-r--r--source/blender/compositor/intern/COM_NodeOperationBuilder.cc4
3 files changed, 8 insertions, 13 deletions
diff --git a/source/blender/compositor/intern/COM_NodeGraph.cc b/source/blender/compositor/intern/COM_NodeGraph.cc
index d8220099f1f..3bed9cdac03 100644
--- a/source/blender/compositor/intern/COM_NodeGraph.cc
+++ b/source/blender/compositor/intern/COM_NodeGraph.cc
@@ -83,7 +83,7 @@ void NodeGraph::add_node(Node *node,
node->setInstanceKey(key);
node->setIsInActiveGroup(is_active_group);
- m_nodes.push_back(node);
+ m_nodes.append(node);
DebugInfo::node_added(node);
}
@@ -156,7 +156,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 (blender::Vector<Node *>::iterator 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);
@@ -170,7 +170,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 (blender::Vector<Node *>::iterator 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);
diff --git a/source/blender/compositor/intern/COM_NodeGraph.h b/source/blender/compositor/intern/COM_NodeGraph.h
index 990e3a30831..7533c6915e7 100644
--- a/source/blender/compositor/intern/COM_NodeGraph.h
+++ b/source/blender/compositor/intern/COM_NodeGraph.h
@@ -22,7 +22,6 @@
#include <map>
#include <set>
-#include <vector>
#include "DNA_node_types.h"
@@ -50,18 +49,15 @@ class NodeGraph {
}
};
- typedef std::vector<Node *> Nodes;
- typedef Nodes::iterator NodeIterator;
-
private:
- Nodes m_nodes;
+ blender::Vector<Node *> m_nodes;
blender::Vector<Link> m_links;
public:
NodeGraph();
~NodeGraph();
- const Nodes &nodes() const
+ const blender::Vector<Node *> &nodes() const
{
return m_nodes;
}
@@ -73,7 +69,8 @@ class NodeGraph {
void from_bNodeTree(const CompositorContext &context, bNodeTree *tree);
protected:
- typedef std::pair<NodeIterator, NodeIterator> NodeRange;
+ typedef std::pair<blender::Vector<Node *>::iterator, blender::Vector<Node *>::iterator>
+ NodeRange;
typedef std::vector<NodeInput *> NodeInputs;
static bNodeSocket *find_b_node_input(bNode *b_node, const char *identifier);
diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.cc b/source/blender/compositor/intern/COM_NodeOperationBuilder.cc
index 1c741283c7b..da9cadd05b6 100644
--- a/source/blender/compositor/intern/COM_NodeOperationBuilder.cc
+++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.cc
@@ -53,9 +53,7 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
/* interface handle for nodes */
NodeConverter converter(this);
- for (int index = 0; index < m_graph.nodes().size(); index++) {
- Node *node = (Node *)m_graph.nodes()[index];
-
+ for (Node *node : m_graph.nodes()) {
m_current_node = node;
DebugInfo::node_to_operations(node);