diff --git a/components/misc/strings/algorithm.hpp b/components/misc/strings/algorithm.hpp index 942feb0728..2bf7125c8b 100644 --- a/components/misc/strings/algorithm.hpp +++ b/components/misc/strings/algorithm.hpp @@ -15,9 +15,9 @@ namespace Misc::StringUtils bool operator()(char x, char y) const { return toLower(x) < toLower(y); } }; - inline std::string underscoresToSpaces(const std::string& oldName) + inline std::string underscoresToSpaces(const std::string_view& oldName) { - std::string newName = oldName; + std::string newName(oldName); std::replace(newName.begin(), newName.end(), '_', ' '); return newName; }