RemoteTagCache: use the pop_front() return value
This commit is contained in:
parent
c74cf79e0f
commit
bef7ce37d9
|
@ -83,8 +83,7 @@ RemoteTagCache::InvokeHandlers() noexcept
|
||||||
const std::scoped_lock<Mutex> lock(mutex);
|
const std::scoped_lock<Mutex> lock(mutex);
|
||||||
|
|
||||||
while (!invoke_list.empty()) {
|
while (!invoke_list.empty()) {
|
||||||
auto &item = invoke_list.front();
|
auto &item = invoke_list.pop_front();
|
||||||
invoke_list.pop_front();
|
|
||||||
idle_list.push_back(item);
|
idle_list.push_back(item);
|
||||||
|
|
||||||
const ScopeUnlock unlock(mutex);
|
const ScopeUnlock unlock(mutex);
|
||||||
|
@ -93,8 +92,7 @@ RemoteTagCache::InvokeHandlers() noexcept
|
||||||
|
|
||||||
/* evict items if there are too many */
|
/* evict items if there are too many */
|
||||||
while (map.size() > MAX_SIZE && !idle_list.empty()) {
|
while (map.size() > MAX_SIZE && !idle_list.empty()) {
|
||||||
auto *item = &idle_list.front();
|
auto *item = &idle_list.pop_front();
|
||||||
idle_list.pop_front();
|
|
||||||
map.erase(map.iterator_to(*item));
|
map.erase(map.iterator_to(*item));
|
||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue