Avoid unnecessary copy of goal log

The data was (accidentally?) copied into a std::string,
even though the string is immediately converted into a std::string_view.
The code has been changed to construct a std::string_view directly,
such that one copy less happens.
This commit is contained in:
Las Safin 2024-01-13 19:27:20 +00:00
parent cbd5553d57
commit f61d951909
No known key found for this signature in database
GPG Key ID: E7FA928911B61ED6

View File

@ -449,7 +449,7 @@ void Worker::waitForInput()
} else {
printMsg(lvlVomit, "%1%: read %2% bytes",
goal->getName(), rd);
std::string data((char *) buffer.data(), rd);
std::string_view data((char *) buffer.data(), rd);
j->lastOutput = after;
goal->handleChildOutput(k, data);
}