We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a3b9f2 commit 4525c5dCopy full SHA for 4525c5d
include/pybind11/stl_bind.h
@@ -667,13 +667,7 @@ struct KeysViewImpl : public KeysView {
667
explicit KeysViewImpl(Map &map) : map(map) {}
668
size_t len() override { return map.size(); }
669
iterator iter() override { return make_key_iterator(map.begin(), map.end()); }
670
- bool contains(const typename Map::key_type &k) override {
671
- auto it = map.find(k);
672
- if (it == map.end()) {
673
- return false;
674
- }
675
- return true;
676
+ bool contains(const typename Map::key_type &k) override { return map.find(k) != map.end(); }
677
bool contains(const object &) override { return false; }
678
Map ↦
679
};
0 commit comments