Skip to content

Commit 4a3444a

Browse files
committed
clang-tidy fixes related to the just-merged PR #3080. Also fixing a minor clang-format mishap.
1 parent e7d146b commit 4a3444a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/pybind11/detail/smart_holder_type_casters.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class modified_type_caster_generic_load_impl {
176176
return true;
177177
}
178178
// Case 2: We have a derived class
179-
else if (PyType_IsSubtype(srctype, typeinfo->type)) {
179+
if (PyType_IsSubtype(srctype, typeinfo->type)) {
180180
auto &bases = all_type_info(srctype); // subtype bases
181181
bool no_cpp_mi = typeinfo->simple_type;
182182

@@ -195,7 +195,7 @@ class modified_type_caster_generic_load_impl {
195195
// Case 2b: the python type inherits from multiple C++ bases. Check the bases to see if
196196
// we can find an exact match (or, for a simple C++ type, an inherited match); if so, we
197197
// can safely reinterpret_cast to the relevant pointer.
198-
else if (bases.size() > 1) {
198+
if (bases.size() > 1) {
199199
for (auto base : bases) {
200200
if (no_cpp_mi ? PyType_IsSubtype(base->type, typeinfo->type) : base->type == typeinfo->type) {
201201
this_.load_value_and_holder(reinterpret_cast<instance *>(src.ptr())->get_value_and_holder(base));
@@ -278,8 +278,8 @@ struct smart_holder_type_caster_class_hooks : smart_holder_type_caster_base_tag
278278
}
279279

280280
// Adopting existing approach used by type_caster_base, although it leads to somewhat fuzzy
281-
// ownership semantics: if we detected via shared_from_this that a shared_ptr exists already, it
282-
// is reused, irrespective of the return_value_policy in effect.
281+
// ownership semantics: if we detected via shared_from_this that a shared_ptr exists already,
282+
// it is reused, irrespective of the return_value_policy in effect.
283283
// "SomeBaseOfWrappedType" is needed because std::enable_shared_from_this is not necessarily a
284284
// direct base of WrappedType.
285285
template <typename WrappedType, typename SomeBaseOfWrappedType>

0 commit comments

Comments
 (0)