Socket: Make use of std::erase_if

This commit is contained in:
Lioncash 2023-12-12 13:29:33 -05:00
parent 96eac73d11
commit e69ac2d43e

View File

@ -1047,10 +1047,7 @@ void WiiSockMan::UpdatePollCommands()
auto& system = Core::System::GetInstance();
auto& memory = system.GetMemory();
pending_polls.erase(
std::remove_if(
pending_polls.begin(), pending_polls.end(),
[&system, &memory, this](PollCommand& pcmd) {
std::erase_if(pending_polls, [&system, &memory, this](PollCommand& pcmd) {
const auto request = Request(system, pcmd.request_addr);
auto& pfds = pcmd.wii_fds;
int ret = 0;
@ -1099,14 +1096,12 @@ void WiiSockMan::UpdatePollCommands()
// memory.Write_U32(ufds[i].fd, request.buffer_out + 0xc*i); //fd
// memory.Write_U32(events, request.buffer_out + 0xc*i + 4); //events
memory.Write_U32(revents, pcmd.buffer_out + 0xc * i + 8); // revents
DEBUG_LOG_FMT(IOS_NET,
"IOCTL_SO_POLL socket {} wevents {:08X} events {:08X} revents {:08X}",
DEBUG_LOG_FMT(IOS_NET, "IOCTL_SO_POLL socket {} wevents {:08X} events {:08X} revents {:08X}",
i, revents, pfds[i].events, pfds[i].revents);
}
GetIOS()->EnqueueIPCReply(request, ret);
return true;
}),
pending_polls.end());
});
}
void WiiSockMan::ToNativeAddrIn(const u8* addr, sockaddr_in* to)