Skip to content

Commit 6b56d3c

Browse files
committed
Update xstrided_view_base.hpp
1 parent c4724db commit 6b56d3c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/xtensor/views/xstrided_view_base.hpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -903,8 +903,11 @@ namespace xt
903903
if (ptr != nullptr)
904904
{
905905
auto slice0 = static_cast<old_strides_value_type>(*ptr);
906-
if (slice0 < 0) slice0 += shape[i_ax];
907-
if (slice0 < 0 || slice0 >= shape[i_ax])
906+
if (slice0 < 0)
907+
{
908+
slice0 += shape[i_ax];
909+
}
910+
if (slice0 < 0 || slice0 >= shape[i_ax])
908911
{
909912
XTENSOR_THROW(std::runtime_error, "Slice index out of range.");
910913
}

0 commit comments

Comments
 (0)