Skip to content

Commit f1be8f8

Browse files
style: pre-commit fixes
1 parent 0c4b241 commit f1be8f8

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

include/pybind11/numpy.h

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ struct PyArrayDescr2_Proxy {
101101
PyObject *names;
102102
};
103103

104-
105104
struct PyArray_Proxy {
106105
PyObject_HEAD
107106
char *data;
@@ -648,8 +647,7 @@ class dtype : public object {
648647
ssize_t itemsize() const {
649648
if (detail::npy_api::get().PyArray_RUNTIME_VERSION_ < 0x12) {
650649
return detail::array_descriptor1_proxy(m_ptr)->elsize;
651-
}
652-
else {
650+
} else {
653651
return detail::array_descriptor2_proxy(m_ptr)->elsize;
654652
}
655653
}
@@ -658,11 +656,9 @@ class dtype : public object {
658656
bool has_fields() const {
659657
if (detail::npy_api::get().PyArray_RUNTIME_VERSION_ < 0x12) {
660658
return detail::array_descriptor1_proxy(m_ptr)->names != nullptr;
661-
}
662-
else if (num() < 0 || num() > 2000) {
659+
} else if (num() < 0 || num() > 2000) {
663660
return false;
664-
}
665-
else {
661+
} else {
666662
return detail::array_descriptor2_proxy(m_ptr)->names != nullptr;
667663
}
668664
}
@@ -695,18 +691,16 @@ class dtype : public object {
695691
ssize_t alignment() const {
696692
if (detail::npy_api::get().PyArray_RUNTIME_VERSION_ < 0x12) {
697693
return detail::array_descriptor1_proxy(m_ptr)->alignment;
698-
}
699-
else {
694+
} else {
700695
return detail::array_descriptor2_proxy(m_ptr)->alignment;
701696
}
702697
}
703698

704699
/// Flags for the array descriptor
705700
std::uint64_t flags() const {
706701
if (detail::npy_api::get().PyArray_RUNTIME_VERSION_ < 0x12) {
707-
return (unsigned char)detail::array_descriptor1_proxy(m_ptr)->flags;
708-
}
709-
else {
702+
return (unsigned char) detail::array_descriptor1_proxy(m_ptr)->flags;
703+
} else {
710704
return detail::array_descriptor2_proxy(m_ptr)->flags;
711705
}
712706
}
@@ -876,9 +870,7 @@ class array : public buffer {
876870
}
877871

878872
/// Byte size of a single element
879-
ssize_t itemsize() const {
880-
return dtype().itemsize();
881-
}
873+
ssize_t itemsize() const { return dtype().itemsize(); }
882874

883875
/// Total number of bytes
884876
ssize_t nbytes() const { return size() * itemsize(); }

0 commit comments

Comments
 (0)