diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-08 23:29:10 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-08 23:30:23 +0300 |
commit | 31bc76ea4e4b83a728b88735bee48019125b4c54 (patch) | |
tree | a9a86d604b3cfb74edee2286ad309f0f43c0d445 /source/blender/blenkernel | |
parent | 403384998a6bb5f428e15ced5503206b45032b25 (diff) |
Cleanup: remove unnecessary calls to as_span
This uses the new implicit conversions and constructors
that have been committed in the previous commit.
I tested these changes on Linux with gcc and on Windows.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_derived_node_tree.hh | 20 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_node_tree_ref.hh | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node_tree_ref.cc | 4 |
3 files changed, 21 insertions, 21 deletions
diff --git a/source/blender/blenkernel/BKE_derived_node_tree.hh b/source/blender/blenkernel/BKE_derived_node_tree.hh index 2ed96f0c60d..3790d06a534 100644 --- a/source/blender/blenkernel/BKE_derived_node_tree.hh +++ b/source/blender/blenkernel/BKE_derived_node_tree.hh @@ -313,12 +313,12 @@ inline const InputSocketRef &DInputSocket::socket_ref() const inline Span<const DOutputSocket *> DInputSocket::linked_sockets() const { - return linked_sockets_.as_span(); + return linked_sockets_; } inline Span<const DGroupInput *> DInputSocket::linked_group_inputs() const { - return linked_group_inputs_.as_span(); + return linked_group_inputs_; } inline bool DInputSocket::is_linked() const @@ -337,7 +337,7 @@ inline const OutputSocketRef &DOutputSocket::socket_ref() const inline Span<const DInputSocket *> DOutputSocket::linked_sockets() const { - return linked_sockets_.as_span(); + return linked_sockets_; } /* -------------------------------------------------------------------- @@ -361,7 +361,7 @@ inline const DParentNode *DGroupInput::parent() const inline Span<const DInputSocket *> DGroupInput::linked_sockets() const { - return linked_sockets_.as_span(); + return linked_sockets_; } inline uint DGroupInput::id() const @@ -453,7 +453,7 @@ inline uint DParentNode::id() const inline Span<const DNode *> DerivedNodeTree::nodes() const { - return nodes_by_id_.as_span(); + return nodes_by_id_; } inline Span<const DNode *> DerivedNodeTree::nodes_by_type(StringRefNull idname) const @@ -469,28 +469,28 @@ inline Span<const DNode *> DerivedNodeTree::nodes_by_type(const bNodeType *nodet return {}; } else { - return nodes->as_span(); + return *nodes; } } inline Span<const DSocket *> DerivedNodeTree::sockets() const { - return sockets_by_id_.as_span(); + return sockets_by_id_; } inline Span<const DInputSocket *> DerivedNodeTree::input_sockets() const { - return input_sockets_.as_span(); + return input_sockets_; } inline Span<const DOutputSocket *> DerivedNodeTree::output_sockets() const { - return output_sockets_.as_span(); + return output_sockets_; } inline Span<const DGroupInput *> DerivedNodeTree::group_inputs() const { - return group_inputs_.as_span(); + return group_inputs_; } } // namespace blender::bke diff --git a/source/blender/blenkernel/BKE_node_tree_ref.hh b/source/blender/blenkernel/BKE_node_tree_ref.hh index e25849cb569..b1e8904d718 100644 --- a/source/blender/blenkernel/BKE_node_tree_ref.hh +++ b/source/blender/blenkernel/BKE_node_tree_ref.hh @@ -197,12 +197,12 @@ class NodeTreeRef : NonCopyable, NonMovable { inline Span<const SocketRef *> SocketRef::linked_sockets() const { - return linked_sockets_.as_span(); + return linked_sockets_; } inline Span<const SocketRef *> SocketRef::directly_linked_sockets() const { - return directly_linked_sockets_.as_span(); + return directly_linked_sockets_; } inline bool SocketRef::is_linked() const @@ -326,12 +326,12 @@ inline const NodeTreeRef &NodeRef::tree() const inline Span<const InputSocketRef *> NodeRef::inputs() const { - return inputs_.as_span(); + return inputs_; } inline Span<const OutputSocketRef *> NodeRef::outputs() const { - return outputs_.as_span(); + return outputs_; } inline const InputSocketRef &NodeRef::input(uint index) const @@ -400,7 +400,7 @@ inline bool NodeRef::is_group_output_node() const inline Span<const NodeRef *> NodeTreeRef::nodes() const { - return nodes_by_id_.as_span(); + return nodes_by_id_; } inline Span<const NodeRef *> NodeTreeRef::nodes_by_type(StringRefNull idname) const @@ -416,23 +416,23 @@ inline Span<const NodeRef *> NodeTreeRef::nodes_by_type(const bNodeType *nodetyp return {}; } else { - return nodes->as_span(); + return *nodes; } } inline Span<const SocketRef *> NodeTreeRef::sockets() const { - return sockets_by_id_.as_span(); + return sockets_by_id_; } inline Span<const InputSocketRef *> NodeTreeRef::input_sockets() const { - return input_sockets_.as_span(); + return input_sockets_; } inline Span<const OutputSocketRef *> NodeTreeRef::output_sockets() const { - return output_sockets_.as_span(); + return output_sockets_; } inline bNodeTree *NodeTreeRef::btree() const diff --git a/source/blender/blenkernel/intern/node_tree_ref.cc b/source/blender/blenkernel/intern/node_tree_ref.cc index 54ea2d338db..5c998a06cb5 100644 --- a/source/blender/blenkernel/intern/node_tree_ref.cc +++ b/source/blender/blenkernel/intern/node_tree_ref.cc @@ -52,8 +52,8 @@ NodeTreeRef::NodeTreeRef(bNodeTree *btree) : btree_(btree) RNA_pointer_create(&btree->id, &RNA_NodeSocket, bsocket, &socket.rna_); } - input_sockets_.extend(node.inputs_); - output_sockets_.extend(node.outputs_); + input_sockets_.extend(node.inputs_.as_span()); + output_sockets_.extend(node.outputs_.as_span()); node_mapping.add_new(bnode, &node); } |