From 83324fe77dced89c6369b75ecf91899078508e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 3 Jun 2018 14:55:39 +0200 Subject: [PATCH] StringUtil: Remove ValueToString(std::string) Doesn't make a lot of sense to have a function that gives the string representation for a string. --- Source/Core/Common/Config/Layer.h | 8 ++++++-- Source/Core/Common/StringUtil.cpp | 5 ----- Source/Core/Common/StringUtil.h | 1 - 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Source/Core/Common/Config/Layer.h b/Source/Core/Common/Config/Layer.h index 4fabb3dc81..2e84d6c3d1 100644 --- a/Source/Core/Common/Config/Layer.h +++ b/Source/Core/Common/Config/Layer.h @@ -120,13 +120,17 @@ public: template void Set(const ConfigInfo& config_info, const std::common_type_t& value) { - Set(config_info.location, value); + Set(config_info.location, value); } template void Set(const ConfigLocation& location, const T& value) { - const std::string new_value = ValueToString(value); + Set(location, ValueToString(value)); + } + + void Set(const ConfigLocation& location, const std::string& new_value) + { std::optional& current_value = m_map[location]; if (current_value == new_value) return; diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index 372ea06c19..c2a5a62b2d 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -332,11 +332,6 @@ std::string ValueToString(bool value) return value ? "True" : "False"; } -std::string ValueToString(const std::string& value) -{ - return value; -} - bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _pFilename, std::string* _pExtension) { diff --git a/Source/Core/Common/StringUtil.h b/Source/Core/Common/StringUtil.h index c548b0e87c..11c873bdae 100644 --- a/Source/Core/Common/StringUtil.h +++ b/Source/Core/Common/StringUtil.h @@ -90,7 +90,6 @@ std::string ValueToString(double value); std::string ValueToString(int value); std::string ValueToString(s64 value); std::string ValueToString(bool value); -std::string ValueToString(const std::string& value); template ::value>* = nullptr> std::string ValueToString(T value) {