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 | |
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')
6 files changed, 26 insertions, 26 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); } diff --git a/source/blender/functions/FN_generic_vector_array.hh b/source/blender/functions/FN_generic_vector_array.hh index f28e94b34ee..2672484c184 100644 --- a/source/blender/functions/FN_generic_vector_array.hh +++ b/source/blender/functions/FN_generic_vector_array.hh @@ -78,7 +78,7 @@ class GVectorArray : NonCopyable, NonMovable { operator GVArraySpan() const { - return GVArraySpan(type_, starts_.as_span(), lengths_); + return GVArraySpan(type_, starts_, lengths_); } bool is_empty() const @@ -98,7 +98,7 @@ class GVectorArray : NonCopyable, NonMovable { Span<const void *> starts() const { - return starts_.as_span(); + return starts_; } Span<uint> lengths() const diff --git a/source/blender/functions/FN_multi_function_network.hh b/source/blender/functions/FN_multi_function_network.hh index 493b26e6510..42f24d9c44c 100644 --- a/source/blender/functions/FN_multi_function_network.hh +++ b/source/blender/functions/FN_multi_function_network.hh @@ -481,7 +481,7 @@ inline Span<MFInputSocket *> MFOutputSocket::targets() inline Span<const MFInputSocket *> MFOutputSocket::targets() const { - return targets_.as_span(); + return targets_; } /* -------------------------------------------------------------------- diff --git a/source/blender/functions/intern/multi_function_network_optimization.cc b/source/blender/functions/intern/multi_function_network_optimization.cc index 690c3330045..f3618612bc5 100644 --- a/source/blender/functions/intern/multi_function_network_optimization.cc +++ b/source/blender/functions/intern/multi_function_network_optimization.cc @@ -287,14 +287,14 @@ void constant_folding(MFNetwork &network, ResourceCollector &resources) } Array<MFOutputSocket *> folded_sockets = compute_constant_sockets_and_add_folded_nodes( - network, inputs_to_fold.as_span(), resources); + network, inputs_to_fold, resources); for (uint i : inputs_to_fold.index_range()) { MFOutputSocket &original_socket = *inputs_to_fold[i]->origin(); network.relink(original_socket, *folded_sockets[i]); } - network.remove(temporary_nodes.as_span()); + network.remove(temporary_nodes); } /** \} */ |