diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2019-01-17 01:59:27 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2019-01-17 10:05:30 +0000 |
commit | c82d2cbd546f70d71493db483e8c2d82e6c022e1 (patch) | |
tree | 507a041f7108d4f74431806be06dce898a363bce /src | |
parent | 5f5e82b0b6c9102b1f05caef04aa45ee51737b62 (diff) | |
download | qt-creator-c82d2cbd546f70d71493db483e8c2d82e6c022e1.tar.gz |
Fix warning: "Don't call QList::last() on temporary"
[-Wclazy-detaching-temporary]
Change-Id: I5e06e44fc45c80ea1dca518611d4f0c28a738061
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/cpptools/cppfindreferences.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qmljseditor/quicktoolbar.cpp | 4 | ||||
-rw-r--r-- | src/plugins/valgrind/callgrind/callgrindparser.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp index b017cb7e8f..00f46399ec 100644 --- a/src/plugins/cpptools/cppfindreferences.cpp +++ b/src/plugins/cpptools/cppfindreferences.cpp @@ -350,7 +350,7 @@ void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol, if (symbol->isClass() || symbol->isForwardClassDeclaration()) { CPlusPlus::Overview overview; - parameters.prettySymbolName = overview.prettyName(context.path(symbol).last()); + parameters.prettySymbolName = overview.prettyName(context.path(symbol).constLast()); } search->setUserData(qVariantFromValue(parameters)); diff --git a/src/plugins/qmljseditor/quicktoolbar.cpp b/src/plugins/qmljseditor/quicktoolbar.cpp index f83cc2e13e..89c6dc349b 100644 --- a/src/plugins/qmljseditor/quicktoolbar.cpp +++ b/src/plugins/qmljseditor/quicktoolbar.cpp @@ -309,8 +309,8 @@ void QuickToolBar::setProperty(const QString &propertyName, const QVariant &valu int column; - int changeSetPos = changeSet.operationList().last().pos1; - int changeSetLength = changeSet.operationList().last().text.length(); + int changeSetPos = changeSet.operationList().constLast().pos1; + int changeSetLength = changeSet.operationList().constLast().text.length(); QTextCursor tc = m_editorWidget->textCursor(); tc.beginEditBlock(); changeSet.apply(&tc); diff --git a/src/plugins/valgrind/callgrind/callgrindparser.cpp b/src/plugins/valgrind/callgrind/callgrindparser.cpp index 620734df2f..384da898c5 100644 --- a/src/plugins/valgrind/callgrind/callgrindparser.cpp +++ b/src/plugins/valgrind/callgrind/callgrindparser.cpp @@ -479,7 +479,7 @@ void Parser::Private::parseCostItem(const char *begin, const char *end) const CostItem *lastCostItem = nullptr; if (!currentFunction->costItems().isEmpty()) - lastCostItem = currentFunction->costItems().last(); + lastCostItem = currentFunction->costItems().constLast(); // parse positions ("where") for (int i = 0; i < addressValuesCount; ++i) { |