diff --git a/Source/Core/VideoCommon/NetPlayChatUI.cpp b/Source/Core/VideoCommon/NetPlayChatUI.cpp index 29becc020f..6c8bce9227 100644 --- a/Source/Core/VideoCommon/NetPlayChatUI.cpp +++ b/Source/Core/VideoCommon/NetPlayChatUI.cpp @@ -78,12 +78,12 @@ void NetPlayChatUI::Display() ImGui::End(); } -void NetPlayChatUI::AppendChat(const std::string& message, NetPlayChatUI::Color color) +void NetPlayChatUI::AppendChat(std::string message, Color color) { if (m_messages.size() > MAX_BACKLOG_SIZE) m_messages.pop_front(); - m_messages.push_back({message, color}); + m_messages.emplace_back(std::move(message), color); // Only scroll to bottom, if we were at the bottom previously if (m_is_scrolled_to_bottom) diff --git a/Source/Core/VideoCommon/NetPlayChatUI.h b/Source/Core/VideoCommon/NetPlayChatUI.h index baef71329b..8ec13a770d 100644 --- a/Source/Core/VideoCommon/NetPlayChatUI.h +++ b/Source/Core/VideoCommon/NetPlayChatUI.h @@ -20,7 +20,7 @@ public: using Color = std::array; void Display(); - void AppendChat(const std::string& message, Color color); + void AppendChat(std::string message, Color color); void SendMessage(); void Activate();