RemoteTagCache: use the pop_front() return value

This commit is contained in:
Max Kellermann 2023-09-16 22:10:10 +02:00
parent c74cf79e0f
commit bef7ce37d9
1 changed files with 2 additions and 4 deletions

View File

@ -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;
}