From c2790a3f86630447b2d30d1c5eae8efd6ee48f2e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 5 Dec 2018 15:59:48 -0500 Subject: [PATCH] yuzu/wait_tree: Pass QString by value and std::move in the initializer list for WaitTreeText Just a trivial modernization that potentially avoids copying strings in certain scenarios. --- src/citra_qt/debugger/wait_tree.cpp | 3 ++- src/citra_qt/debugger/wait_tree.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/citra_qt/debugger/wait_tree.cpp b/src/citra_qt/debugger/wait_tree.cpp index 0758cc7926..15dc90ba07 100644 --- a/src/citra_qt/debugger/wait_tree.cpp +++ b/src/citra_qt/debugger/wait_tree.cpp @@ -61,7 +61,8 @@ std::vector> WaitTreeItem::MakeThreadItemList() return item_list; } -WaitTreeText::WaitTreeText(const QString& t) : text(t) {} +WaitTreeText::WaitTreeText(QString t) : text(std::move(t)) {} +WaitTreeText::~WaitTreeText() = default; QString WaitTreeText::GetText() const { return text; diff --git a/src/citra_qt/debugger/wait_tree.h b/src/citra_qt/debugger/wait_tree.h index befa3ba02c..469072a301 100644 --- a/src/citra_qt/debugger/wait_tree.h +++ b/src/citra_qt/debugger/wait_tree.h @@ -50,7 +50,9 @@ private: class WaitTreeText : public WaitTreeItem { Q_OBJECT public: - explicit WaitTreeText(const QString& text); + explicit WaitTreeText(QString text); + ~WaitTreeText() override; + QString GetText() const override; private: