From 3d0d03b871d7ea2cd668abfbcb3ba1ecf0e77ceb Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Sat, 28 Sep 2024 20:32:59 -0700 Subject: [PATCH] Modernize `std::partition` with ranges The new return value is `std::ranges::subrange`. --- Source/Core/Core/IOS/Network/Socket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/IOS/Network/Socket.cpp b/Source/Core/Core/IOS/Network/Socket.cpp index b5ab5ffc4e..9e30d856d1 100644 --- a/Source/Core/Core/IOS/Network/Socket.cpp +++ b/Source/Core/Core/IOS/Network/Socket.cpp @@ -1085,10 +1085,10 @@ void WiiSockMan::UpdatePollCommands() std::vector original_order(pfds.size()); std::iota(original_order.begin(), original_order.end(), 0); // Select indices with valid fds - auto mid = std::partition(original_order.begin(), original_order.end(), [&](auto i) { + const auto partition_result = std::ranges::partition(original_order, [&](auto i) { return GetHostSocket(memory.Read_U32(pcmd.buffer_out + 0xc * i)) >= 0; }); - const auto n_valid = std::distance(original_order.begin(), mid); + const auto n_valid = std::distance(original_order.begin(), partition_result.begin()); // Move all the valid pollfds to the front of the vector for (auto i = 0; i < n_valid; ++i)