Skip to content

Commit

Permalink
Passed data_descriptor to build_array by const ref
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed Jun 28, 2024
1 parent 41247c3 commit 4b63279
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/sparrow/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ namespace sparrow
private:

using array_variant = array_traits::array_variant;
array_variant build_array(data_descriptor d, array_data data) const;
array_variant build_array(const data_descriptor& d, array_data data) const;

data_descriptor m_data_descriptor;
array_variant m_array;
Expand Down Expand Up @@ -232,7 +232,7 @@ namespace sparrow
* array implementation *
************************/

inline auto array::build_array(data_descriptor dd, array_data data) const -> array_variant
inline auto array::build_array(const data_descriptor& dd, array_data data) const -> array_variant
{
switch (dd.id())
{
Expand Down Expand Up @@ -275,8 +275,8 @@ namespace sparrow
}

inline array::array(data_descriptor dd, array_data data)
: m_data_descriptor(dd)
, m_array(build_array(std::move(dd), std::move(data)))
: m_data_descriptor(std::move(dd))
, m_array(build_array(m_data_descriptor, std::move(data)))
{
}

Expand Down

0 comments on commit 4b63279

Please sign in to comment.