From f0fa692457495481b778f3cc86bde300cd22ef12 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 21 Mar 2017 17:22:28 -0400 Subject: [PATCH] GeckoCodeConfig: Move gecko code title building to its own function Keeps it separate from the rest of the saving code and also allows for easy rvalue-reference moving into the lines vector as a side-benefit. --- Source/Core/Core/GeckoCodeConfig.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Source/Core/Core/GeckoCodeConfig.cpp b/Source/Core/Core/GeckoCodeConfig.cpp index f50b848d68..712b186b65 100644 --- a/Source/Core/Core/GeckoCodeConfig.cpp +++ b/Source/Core/Core/GeckoCodeConfig.cpp @@ -97,6 +97,18 @@ std::vector LoadCodes(const IniFile& globalIni, const IniFile& localI return gcodes; } +static std::string MakeGeckoCodeTitle(const GeckoCode& code) +{ + std::string title = '$' + code.name; + + if (!code.creator.empty()) + { + title += " [" + code.creator + ']'; + } + + return title; +} + // used by the SaveGeckoCodes function static void SaveGeckoCode(std::vector& lines, std::vector& enabledLines, const GeckoCode& gcode) @@ -107,21 +119,7 @@ static void SaveGeckoCode(std::vector& lines, std::vector