mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
cmCursesLongMessageForm: avoid unnecessary string allocation
The addition makes a temporary string and then drops it after adding it to `this->Messages`. Instead, just incrementally append.
This commit is contained in:
@@ -41,7 +41,8 @@ void cmCursesLongMessageForm::UpdateContent(std::string const& output,
|
||||
this->Title = title;
|
||||
|
||||
if (!output.empty() && this->Messages.size() < MAX_CONTENT_SIZE) {
|
||||
this->Messages.append("\n" + output);
|
||||
this->Messages.push_back('\n');
|
||||
this->Messages.append(output);
|
||||
form_driver(this->Form, REQ_NEW_LINE);
|
||||
this->DrawMessage(output.c_str());
|
||||
}
|
||||
|
Reference in New Issue
Block a user