Modernize std::replace with ranges

This commit is contained in:
mitaclaw
2024-09-29 11:08:08 -07:00
parent 72436a0d1f
commit 0a80243a92
5 changed files with 6 additions and 6 deletions

View File

@ -234,8 +234,8 @@ std::string_view StripQuotes(std::string_view s)
// Turns "\n\rhello" into " hello".
void ReplaceBreaksWithSpaces(std::string& str)
{
std::replace(str.begin(), str.end(), '\r', ' ');
std::replace(str.begin(), str.end(), '\n', ' ');
std::ranges::replace(str, '\r', ' ');
std::ranges::replace(str, '\n', ' ');
}
void TruncateToCString(std::string* s)