Skip to content

Commit 444dbe5

Browse files
committed
Addressed comments
1 parent d0506d8 commit 444dbe5

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

include/xtensor/xstrided_view.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -827,27 +827,24 @@ namespace xt
827827
template <
828828
class S,
829829
std::enable_if_t<std::is_signed<get_value_type_t<typename std::decay<S>::type>>::value, bool> = true>
830-
inline auto recalculate_shape_impl(S& shape, size_t size)
830+
inline void recalculate_shape_impl(S& shape, size_t size)
831831
{
832832
using value_type = get_value_type_t<typename std::decay_t<S>>;
833-
const auto num_auto_dims = std::count(shape.cbegin(), shape.cend(), -1);
834-
XTENSOR_ASSERT(num_auto_dims <= 1);
833+
XTENSOR_ASSERT(std::count(shape.cbegin(), shape.cend(), -1) <= 1);
835834
auto iter = std::find(shape.begin(), shape.end(), -1);
836835
if (iter != std::end(shape))
837836
{
838837
const auto total = std::accumulate(shape.cbegin(), shape.cend(), -1, std::multiplies<int>{});
839838
const auto missing_dimension = size / total;
840839
(*iter) = static_cast<value_type>(missing_dimension);
841840
}
842-
return shape;
843841
}
844842

845843
template <
846844
class S,
847845
std::enable_if_t<!std::is_signed<get_value_type_t<typename std::decay<S>::type>>::value, bool> = true>
848-
inline auto recalculate_shape_impl(S& shape, size_t)
846+
inline void recalculate_shape_impl(S&, size_t)
849847
{
850-
return shape;
851848
}
852849

853850
template <class S>

0 commit comments

Comments
 (0)