Skip to content
Permalink
Browse files

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.
  • Loading branch information...
lioncash committed Aug 4, 2019
1 parent 5220922 commit 13292563ee43aef52cebc385d82614a60087618b
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/Core/UICommon/NetPlayIndex.cpp
@@ -333,7 +333,7 @@ bool NetPlayIndex::HasActiveSession() const
return !m_secret.empty();
}

void NetPlayIndex::SetErrorCallback(std::function<void()> function)
void NetPlayIndex::SetErrorCallback(std::function<void()> callback)
{
m_error_callback = function;
m_error_callback = std::move(callback);
}

0 comments on commit 1329256

Please sign in to comment.
You can’t perform that action at this time.