Skip to content

Commit

Permalink
StringUtil: Remove ValueToString(std::string)
Browse files Browse the repository at this point in the history
Doesn't make a lot of sense to have a function that gives the string
representation for a string.
  • Loading branch information
leoetlino committed Jun 3, 2018
1 parent 7e79bf9 commit 83324fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 6 additions & 2 deletions Source/Core/Common/Config/Layer.h
Expand Up @@ -120,13 +120,17 @@ class Layer
template <typename T>
void Set(const ConfigInfo<T>& config_info, const std::common_type_t<T>& value)
{
Set<T>(config_info.location, value);
Set(config_info.location, value);
}

template <typename T>
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<std::string>& current_value = m_map[location];
if (current_value == new_value)
return;
Expand Down
5 changes: 0 additions & 5 deletions Source/Core/Common/StringUtil.cpp
Expand Up @@ -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)
{
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Common/StringUtil.h
Expand Up @@ -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 <typename T, std::enable_if_t<std::is_enum<T>::value>* = nullptr>
std::string ValueToString(T value)
{
Expand Down

0 comments on commit 83324fe

Please sign in to comment.