diff --git a/include/pybind11/detail/type_caster_base.h b/include/pybind11/detail/type_caster_base.h index 50a3b8795..aaf191a60 100644 --- a/include/pybind11/detail/type_caster_base.h +++ b/include/pybind11/detail/type_caster_base.h @@ -792,7 +792,7 @@ public: 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);