mirror of
https://github.com/gabime/spdlog.git
synced 2025-03-04 13:15:48 +08:00
Attributes: invert attr search logic
This commit is contained in:
parent
7d421eb56c
commit
d5889bff8b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user