From 40c002323e47fce78b867f372c107d91307a049e Mon Sep 17 00:00:00 2001 From: Oskari Alaranta Date: Fri, 5 Jun 2026 01:05:23 +0300 Subject: [PATCH] Iterate clients by reference in XRes --- xbanan/ExtXRes.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xbanan/ExtXRes.cpp b/xbanan/ExtXRes.cpp index d4445f1..80abfe7 100644 --- a/xbanan/ExtXRes.cpp +++ b/xbanan/ExtXRes.cpp @@ -7,12 +7,12 @@ template static BAN::ErrorOr for_each_client(uint32_t target_spec, const F& callback) { - for (auto [fd, thingy] : g_epoll_thingies) + for (const auto& [fd, thingy] : g_epoll_thingies) { if (thingy.type != EpollThingy::Type::Client) continue; - Client& client_info = thingy.value.get(); + const auto& client_info = thingy.value.get(); if (target_spec && (target_spec >> 20) != client_info.fd) continue; @@ -61,7 +61,7 @@ BAN::ErrorOr extension_xres(Client& client_info, BAN::ConstByteSpan packet { auto spec = decode(packet).value(); - TRY(for_each_client(spec.client, [&](Client& client_info, uint32_t client_spec) -> BAN::ErrorOr { + TRY(for_each_client(spec.client, [&](const Client& client_info, uint32_t client_spec) -> BAN::ErrorOr { if (spec.mask == None || (spec.mask & X_XResClientXIDMask)) { xXResClientIdValue value {