From bef7ce37d9367d90c97bf4d0ae560c8139a00cd6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 16 Sep 2023 22:10:10 +0200 Subject: [PATCH] RemoteTagCache: use the pop_front() return value --- src/RemoteTagCache.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/RemoteTagCache.cxx b/src/RemoteTagCache.cxx index 362683445..283ebf01f 100644 --- a/src/RemoteTagCache.cxx +++ b/src/RemoteTagCache.cxx @@ -83,8 +83,7 @@ RemoteTagCache::InvokeHandlers() noexcept const std::scoped_lock 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; }