Attributes: invert attr search logic

This commit is contained in:
Felix Heitmann 2024-07-05 14:56:11 +02:00 committed by M4rFri
parent 7d421eb56c
commit d5889bff8b

View File

@ -52,11 +52,12 @@ public:
return attrs.empty();
}
// return {true, iter} if found, {false, end} otherwise
std::pair<bool, const_iter> const get(key_t const& key) const {
auto lck = lock();
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