Skip to content

Commit 7dc20b8

Browse files
committed
clang-tidy std::move ref
1 parent 5345143 commit 7dc20b8

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

gui/resultitem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
#include "resultitem.h"
2020

2121
ResultItem::ResultItem(QSharedPointer<ErrorItem> errorItem, Type type, int errorPathIndex)
22-
: errorItem(errorItem), mType(type), mErrorPathIndex(errorPathIndex)
22+
: errorItem(std::move(errorItem)), mType(type), mErrorPathIndex(errorPathIndex)
2323
{}

gui/test/resultstree/testresultstree.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,16 @@ void TestResultsTree::test1() const
136136

137137
static QErrorPathItem createErrorPathItem(QString file, int line, int column, QString info) {
138138
QErrorPathItem ret;
139-
ret.file = file;
139+
ret.file = std::move(file);
140140
ret.line = line;
141141
ret.column = column;
142-
ret.info = info;
142+
ret.info = std::move(info);
143143
return ret;
144144
}
145145

146-
static ErrorItem createErrorItem(QString file, int line, Severity sev, QString message, QString id) {
146+
static ErrorItem createErrorItem(const QString& file, int line, Severity sev, const QString& message, QString id) {
147147
ErrorItem ret;
148-
ret.errorId = id;
148+
ret.errorId = std::move(id);
149149
ret.severity = sev;
150150
ret.cwe = ret.hash = 0;
151151
ret.file0 = file;
@@ -199,7 +199,7 @@ void TestResultsTree::resultsInSameFile() const
199199
ResultsTree tree(nullptr);
200200
tree.addErrorItem(createErrorItem("file1.c", 10, Severity::style, "test", "bugId"));
201201
tree.addErrorItem(createErrorItem("file1.c", 20, Severity::style, "test", "bugId"));
202-
QStandardItemModel* model = dynamic_cast<QStandardItemModel*>(tree.model());
202+
auto* model = dynamic_cast<QStandardItemModel*>(tree.model());
203203
QVERIFY(model != nullptr);
204204
QVERIFY(model->rowCount() == 1);
205205

0 commit comments

Comments
 (0)