Skip to content

Commit df27188

Browse files
committed
Resolve clang-tidy error:
``` include/pybind11/detail/type_caster_base.h:795:21: error: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty,-warnings-as-errors] if (matching_bases.size() != 0) { ^~~~~~~~~~~~~~~~~~~~~~~~~~ !matching_bases.empty() ```
1 parent 5f5fd6a commit df27188

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/pybind11/detail/type_caster_base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ class type_caster_generic {
792792
matching_bases.push_back(base);
793793
}
794794
}
795-
if (matching_bases.size() != 0) {
795+
if (!matching_bases.empty()) {
796796
if (matching_bases.size() > 1) {
797797
matching_bases.push_back(const_cast<type_info *>(typeinfo));
798798
all_type_info_check_for_divergence(matching_bases);

0 commit comments

Comments
 (0)