1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-07 03:45:33 +00:00

Use std::string_view argument

This commit is contained in:
Sam Hellawell 2024-04-02 15:19:47 +01:00
parent ae68f4600b
commit d5ca678efc

View file

@ -15,9 +15,9 @@ namespace Misc::StringUtils
bool operator()(char x, char y) const { return toLower(x) < toLower(y); } 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(), '_', ' '); std::replace(newName.begin(), newName.end(), '_', ' ');
return newName; return newName;
} }