Skip to content

Commit

Permalink
Resolve clang-tidy error:
Browse files Browse the repository at this point in the history
```
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()
```
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Nov 7, 2023
1 parent 5f5fd6a commit df27188
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/detail/type_caster_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<type_info *>(typeinfo));
all_type_info_check_for_divergence(matching_bases);
Expand Down

0 comments on commit df27188

Please sign in to comment.