optimize by passing by reference
optimize by using std::move
This commit is contained in:
2026-02-14 14:32:47 +01:00
parent 14a4e15962
commit 8b1db7af11
14 changed files with 41 additions and 41 deletions
+3 -3
View File
@@ -7,19 +7,19 @@ UI_status_bar::UI_status_bar(QObject *parent) : UI_item(UI_STATUS_BAR_TYPE, pare
UI_status_bar::UI_status_bar(std::string message, QObject *parent) : UI_item(UI_STATUS_BAR_TYPE, parent), m_timeout(0)
{
m_text = message;
m_text = std::move(message);
setup_item(true, false, false);
}
void UI_status_bar::show_message(std::string message, size_t timeout)
{
// This should work because the message gets only send once when it changes
m_text = message;
m_text = std::move(message);
m_timeout = timeout;
emit ui_changed();
}
std::string UI_status_bar::message() const
std::string UI_status_bar::message() const &
{
return m_text;
}