From d5ca678efc4ad02b530854c95c59095fe76f0719 Mon Sep 17 00:00:00 2001 From: Sam Hellawell Date: Tue, 2 Apr 2024 15:19:47 +0100 Subject: [PATCH] Use std::string_view argument --- components/misc/strings/algorithm.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }