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);
|
||||
|
||||
while (!invoke_list.empty()) {
|
||||
auto &item = invoke_list.front();
|
||||
invoke_list.pop_front();
|
||||
auto &item = invoke_list.pop_front();
|
||||
idle_list.push_back(item);
|
||||
|
||||
const ScopeUnlock unlock(mutex);
|
||||
|
@ -93,8 +92,7 @@ RemoteTagCache::InvokeHandlers() noexcept
|
|||
|
||||
/* evict items if there are too many */
|
||||
while (map.size() > MAX_SIZE && !idle_list.empty()) {
|
||||
auto *item = &idle_list.front();
|
||||
idle_list.pop_front();
|
||||
auto *item = &idle_list.pop_front();
|
||||
map.erase(map.iterator_to(*item));
|
||||
delete item;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue