diff --git a/include/pybind11/detail/type_caster_base.h b/include/pybind11/detail/type_caster_base.h index 50a3b87950..aaf191a60e 100644 --- a/include/pybind11/detail/type_caster_base.h +++ b/include/pybind11/detail/type_caster_base.h @@ -792,7 +792,7 @@ class type_caster_generic { matching_bases.push_back(base); } } - if (matching_bases.size() != 0) { + if (!matching_bases.empty()) { if (matching_bases.size() > 1) { matching_bases.push_back(const_cast(typeinfo)); all_type_info_check_for_divergence(matching_bases);