Skip to content

Commit

Permalink
Apply suggestion by @Skylion007, with additional trivial simplification.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Dec 9, 2022
1 parent 3a3b9f2 commit 4525c5d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions include/pybind11/stl_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,7 @@ struct KeysViewImpl : public KeysView {
explicit KeysViewImpl(Map &map) : map(map) {}
size_t len() override { return map.size(); }
iterator iter() override { return make_key_iterator(map.begin(), map.end()); }
bool contains(const typename Map::key_type &k) override {
auto it = map.find(k);
if (it == map.end()) {
return false;
}
return true;
}
bool contains(const typename Map::key_type &k) override { return map.find(k) != map.end(); }
bool contains(const object &) override { return false; }
Map ↦
};
Expand Down

0 comments on commit 4525c5d

Please sign in to comment.