Source: reduce useless std::string building

This commit is contained in:
AJIOB committed 2026-09-24 20:35:28 +00:00
1 parent 99e8ac2fb6
commit f4bd297d05
1 file changed
+4 -2
+4 -2
View File
@@ -191,7 +191,7 @@ std::string cmOutputConverter::ConvertToOutputFormat(cm::string_view source,
OutputFormat format,
bool useWatcomQuote) const
{
std::string result(source);
std::string result;
// Convert it to an output path.
if (format == SHELL || format == NINJAMULTI) {
result = this->ConvertDirectorySeparatorsForShell(source);
@@ -199,7 +199,9 @@ std::string cmOutputConverter::ConvertToOutputFormat(cm::string_view source,
format == NINJAMULTI);
} else if (format == RESPONSE) {
result =
this->EscapeForShell(result, false, false, useWatcomQuote, false, true);
this->EscapeForShell(source, false, false, useWatcomQuote, false, true);
} else {
result = std::string(source);
}
return result;
}