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
@@ -13,18 +13,18 @@ void UI_textbox::set_text(std::string text)
{
if (text == m_text)
return;
m_text = text;
m_text = std::move(text);
emit ui_changed();
emit changed(m_text);
}
void UI_textbox::set_hint(std::string hint)
{
m_hint = hint;
m_hint = std::move(hint);
emit ui_changed();
}
std::string UI_textbox::hint() const
std::string UI_textbox::hint() const &
{
return m_hint;
}