From 13292563ee43aef52cebc385d82614a60087618b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 4 Aug 2019 12:19:18 -0400 Subject: [PATCH] UICommon/NetPlayIndex: Use std::move within SetErrorCallback() std::function is allowed to heap allocate in order to store captured variables, etc, so std::function isn't a trivial type. We can std::move here in order to avoid potential reallocating. While we're at it, make the definition's parameter name match the declaration's parameter name for consistency. --- Source/Core/UICommon/NetPlayIndex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/UICommon/NetPlayIndex.cpp b/Source/Core/UICommon/NetPlayIndex.cpp index a55121c32b..f7cbd3f557 100644 --- a/Source/Core/UICommon/NetPlayIndex.cpp +++ b/Source/Core/UICommon/NetPlayIndex.cpp @@ -333,7 +333,7 @@ bool NetPlayIndex::HasActiveSession() const return !m_secret.empty(); } -void NetPlayIndex::SetErrorCallback(std::function function) +void NetPlayIndex::SetErrorCallback(std::function callback) { - m_error_callback = function; + m_error_callback = std::move(callback); }