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:
parent
cbd5553d57
commit
f61d951909
|
@ -449,7 +449,7 @@ void Worker::waitForInput()
|
||||||
} else {
|
} else {
|
||||||
printMsg(lvlVomit, "%1%: read %2% bytes",
|
printMsg(lvlVomit, "%1%: read %2% bytes",
|
||||||
goal->getName(), rd);
|
goal->getName(), rd);
|
||||||
std::string data((char *) buffer.data(), rd);
|
std::string_view data((char *) buffer.data(), rd);
|
||||||
j->lastOutput = after;
|
j->lastOutput = after;
|
||||||
goal->handleChildOutput(k, data);
|
goal->handleChildOutput(k, data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue