From e4a34cb9b7d59a08a162d642fbbca8c08804b3ff Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sun, 10 Jun 2018 00:16:59 +0100 Subject: Apply all modernize-* fixes from clang-tidy except for modernize-use-auto --- src/modules/help/HelpIndex.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/modules/help/HelpIndex.cpp') diff --git a/src/modules/help/HelpIndex.cpp b/src/modules/help/HelpIndex.cpp index 8b7db7720..4e37eca2e 100644 --- a/src/modules/help/HelpIndex.cpp +++ b/src/modules/help/HelpIndex.cpp @@ -45,18 +45,24 @@ #include #include #include -#include +#include #include #include #include +#include QT_BEGIN_NAMESPACE struct Term { Term() = default; - Term(const QString & t, int f, QVector l) : term(t), frequency(f), documents(l) {} + Term(QString t, int f, QVector l) + : term(std::move(t)) + , frequency(f) + , documents(std::move(l)) + { + } QString term; int frequency = -1; QVector documents; @@ -77,8 +83,9 @@ QDataStream & operator<<(QDataStream & s, const Document & l) return s; } -HelpIndex::HelpIndex(const QString & dp, const QString & hp) - : QObject(nullptr), docPath(dp) +HelpIndex::HelpIndex(QString dp, const QString & hp) + : QObject(nullptr) + , docPath(std::move(dp)) { Q_UNUSED(hp); @@ -92,8 +99,9 @@ HelpIndex::HelpIndex(const QString & dp, const QString & hp) connect(m_pTimer, SIGNAL(timeout()), this, SLOT(filterNext())); } -HelpIndex::HelpIndex(const QStringList & dl, const QString & hp) - : QObject(nullptr), docList{dl} +HelpIndex::HelpIndex(QStringList dl, const QString & hp) + : QObject(nullptr) + , docList{ std::move(dl) } { Q_UNUSED(hp); -- cgit v1.3.1-10-gc9f91