@@ -176,7 +176,7 @@ class modified_type_caster_generic_load_impl {
176
176
return true ;
177
177
}
178
178
// Case 2: We have a derived class
179
- else if (PyType_IsSubtype (srctype, typeinfo->type )) {
179
+ if (PyType_IsSubtype (srctype, typeinfo->type )) {
180
180
auto &bases = all_type_info (srctype); // subtype bases
181
181
bool no_cpp_mi = typeinfo->simple_type ;
182
182
@@ -195,7 +195,7 @@ class modified_type_caster_generic_load_impl {
195
195
// Case 2b: the python type inherits from multiple C++ bases. Check the bases to see if
196
196
// we can find an exact match (or, for a simple C++ type, an inherited match); if so, we
197
197
// can safely reinterpret_cast to the relevant pointer.
198
- else if (bases.size () > 1 ) {
198
+ if (bases.size () > 1 ) {
199
199
for (auto base : bases) {
200
200
if (no_cpp_mi ? PyType_IsSubtype (base->type , typeinfo->type ) : base->type == typeinfo->type ) {
201
201
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
278
278
}
279
279
280
280
// 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.
283
283
// "SomeBaseOfWrappedType" is needed because std::enable_shared_from_this is not necessarily a
284
284
// direct base of WrappedType.
285
285
template <typename WrappedType, typename SomeBaseOfWrappedType>
0 commit comments