Skip to content

Commit b2cea00

Browse files
committed
run clang-format on xcontainer
1 parent df7abfb commit b2cea00

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

include/xtensor/xcontainer.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,10 +924,15 @@ namespace xt
924924
inline bool xstrided_container<D>::is_contiguous() const noexcept
925925
{
926926
using str_type = typename inner_strides_type::value_type;
927-
auto is_zero = [](auto i){return i == 0;};
927+
auto is_zero = [](auto i)
928+
{
929+
return i == 0;
930+
};
928931
// This is unsafe if the strides are all 0. Does that happen?
929932
if (!is_contiguous_container<storage_type>::value)
933+
{
930934
return false;
935+
}
931936
if (m_layout == layout_type::row_major)
932937
{
933938
auto it = std::find_if_not(m_strides.rbegin(), m_strides.rend(), is_zero);
@@ -939,7 +944,9 @@ namespace xt
939944
auto it = std::find_if_not(m_strides.begin(), m_strides.end(), is_zero);
940945
// If the array has strides of zero, it is a constant, and therefore contiguous.
941946
return it == m_strides.end() || *it == str_type(1);
942-
} else {
947+
}
948+
else
949+
{
943950
return m_strides.empty();
944951
}
945952
}

0 commit comments

Comments
 (0)