From d3ed750c9d72fe73ebcd40686500584fce3a238c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 19 Jun 2018 12:25:13 -0400 Subject: [PATCH] GameFile: Avoid copying map pairs in GetLanguages() We can just reference the pairs instead of taking them by value, avoiding copying std::string instances. --- Source/Core/UICommon/GameFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/UICommon/GameFile.cpp b/Source/Core/UICommon/GameFile.cpp index 0d3f7469be..443f3bc931 100644 --- a/Source/Core/UICommon/GameFile.cpp +++ b/Source/Core/UICommon/GameFile.cpp @@ -308,7 +308,7 @@ std::vector GameFile::GetLanguages() const { std::vector languages; // TODO: What if some languages don't have long names but have other strings? - for (std::pair name : m_long_names) + for (const auto& name : m_long_names) languages.push_back(name.first); return languages; }