We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4724db commit 6b56d3cCopy full SHA for 6b56d3c
1 file changed
include/xtensor/views/xstrided_view_base.hpp
@@ -903,8 +903,11 @@ namespace xt
903
if (ptr != nullptr)
904
{
905
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])
+ if (slice0 < 0)
+ {
908
+ slice0 += shape[i_ax];
909
+ }
910
+ if (slice0 < 0 || slice0 >= shape[i_ax])
911
912
XTENSOR_THROW(std::runtime_error, "Slice index out of range.");
913
}
0 commit comments