diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 2ee74f67e44..0339eb3f70d 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -898,7 +898,7 @@ void ResultsTree::copy() return; QString text; - for (QModelIndex index : mSelectionModel->selectedRows()) { + for (const QModelIndex& index : mSelectionModel->selectedRows()) { QStandardItem *item = mModel.itemFromIndex(index); if (!item->parent()) { text += item->text() + '\n'; @@ -929,7 +929,7 @@ void ResultsTree::hideResult() if (!mSelectionModel) return; - for (QModelIndex index : mSelectionModel->selectedRows()) { + for (const QModelIndex& index : mSelectionModel->selectedRows()) { QStandardItem *item = mModel.itemFromIndex(index); //Set the "hide" flag for this item QVariantMap data = item->data().toMap(); @@ -947,7 +947,7 @@ void ResultsTree::recheckSelectedFiles() return; QStringList selectedItems; - for (QModelIndex index : mSelectionModel->selectedRows()) { + for (const QModelIndex& index : mSelectionModel->selectedRows()) { QStandardItem *item = mModel.itemFromIndex(index); while (item->parent()) item = item->parent(); @@ -1029,7 +1029,7 @@ void ResultsTree::suppressSelectedIds() return; QSet selectedIds; - for (QModelIndex index : mSelectionModel->selectedRows()) { + for (const QModelIndex& index : mSelectionModel->selectedRows()) { QStandardItem *item = mModel.itemFromIndex(index); if (!item->parent()) continue; @@ -1068,7 +1068,7 @@ void ResultsTree::suppressHash() // Extract selected warnings QSet selectedWarnings; - for (QModelIndex index : mSelectionModel->selectedRows()) { + for (const QModelIndex& index : mSelectionModel->selectedRows()) { QStandardItem *item = mModel.itemFromIndex(index); if (!item->parent()) continue; @@ -1115,7 +1115,7 @@ void ResultsTree::tagSelectedItems(const QString &tag) return; bool isTagged = false; ProjectFile *currentProject = ProjectFile::getActiveProject(); - for (QModelIndex index : mSelectionModel->selectedRows()) { + for (const QModelIndex& index : mSelectionModel->selectedRows()) { QStandardItem *item = mModel.itemFromIndex(index); QVariantMap data = item->data().toMap(); if (data.contains("tags")) { diff --git a/lib/library.cpp b/lib/library.cpp index ddd2a13ed90..58c6d8e6f3e 100644 --- a/lib/library.cpp +++ b/lib/library.cpp @@ -694,8 +694,7 @@ Library::Error Library::loadFunction(const tinyxml2::XMLElement * const node, co } else if (functionnodename == "pure") func.ispure = true; else if (functionnodename == "const") { - func.ispure = true; - func.isconst = true; // a constant function is pure + func.isconst = true; } else if (functionnodename == "leak-ignore") func.leakignore = true; else if (functionnodename == "not-overlapping-data") {