Attributes: invert attr search logic

pull/3128/head
Felix Heitmann 1 year ago committed by M4rFri
parent fbba947af4
commit d468e32a88
No known key found for this signature in database

@ -52,11 +52,12 @@ public:
return attrs.empty(); return attrs.empty();
} }
// return {true, iter} if found, {false, end} otherwise
std::pair<bool, const_iter> const get(key_t const& key) const { std::pair<bool, const_iter> const get(key_t const& key) const {
auto lck = lock(); auto lck = lock();
auto value_it = attrs.find(key); auto value_it = attrs.find(key);
return std::make_pair(value_it == attrs.end(), value_it); return std::make_pair(value_it != attrs.end(), value_it);
} }
// provide a local copy of the attributes to be free of race issues // provide a local copy of the attributes to be free of race issues

Loading…
Cancel
Save