From ee813c4a542178b05fcfed78ade4fe1841dcf2e9 Mon Sep 17 00:00:00 2001 From: Jamie Meyer <45072324+HeatXD@users.noreply.github.com> Date: Wed, 17 May 2023 14:44:02 +0200 Subject: [PATCH] Netplay: Move password string instead of copying. --- src/core/netplay.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/netplay.cpp b/src/core/netplay.cpp index fe5291861..44e1c9ee2 100644 --- a/src/core/netplay.cpp +++ b/src/core/netplay.cpp @@ -1871,7 +1871,7 @@ void Netplay::SetInputs(Netplay::Input inputs[2]) bool Netplay::CreateSession(std::string nickname, s32 port, s32 max_players, std::string password) { - s_local_session_password = password; + s_local_session_password = std::move(password); // TODO: This is going to blow away our memory cards, because for sync purposes we want all clients // to have the same data, and we don't want to trash their local memcards. We should therefore load @@ -1896,7 +1896,8 @@ bool Netplay::CreateSession(std::string nickname, s32 port, s32 max_players, std bool Netplay::JoinSession(std::string nickname, const std::string& hostname, s32 port, std::string password) { - s_local_session_password = password; + s_local_session_password = std::move(password); + // TODO: input delay. GGPO Should support changing it on the fly. const s32 input_delay = 1;