Skip to content

Commit 4d5d52a

Browse files
committed
Changes according to review
1 parent 96d3096 commit 4d5d52a

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

include/xtensor/xchunked_array.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,9 @@ namespace xt
338338
xchunked_array<xarray<xarray<T>>, EXT> chunked_array(std::initializer_list<S> shape, std::initializer_list<S> chunk_shape, layout_type chunk_memory_layout)
339339
{
340340
using sh_type = std::vector<std::size_t>;
341-
sh_type sh = xtl::make_sequence<sh_type>(shape.size());
342-
std::copy(shape.begin(), shape.end(), sh.begin());
343-
sh_type ch_sh = xtl::make_sequence<sh_type>(chunk_shape.size());
344-
std::copy(chunk_shape.begin(), chunk_shape.end(), ch_sh.begin());
345-
using chunk_storage = xarray<xarray<T, L>>;
346-
return xchunked_array<chunk_storage, EXT>(chunk_storage(), std::move(sh), std::move(ch_sh), chunk_memory_layout);
341+
auto sh = xtl::forward_sequence<sh_type, std::initializer_list<S>>(shape);
342+
auto ch_sh = xtl::forward_sequence<sh_type, std::initializer_list<S>>(chunk_shape);
343+
return chunked_array<T, L, EXT, sh_type>(std::move(sh), std::move(ch_sh), chunk_memory_layout);
347344
}
348345

349346
template <layout_type L, class EXT, class E, class S>

0 commit comments

Comments
 (0)