From 17314b48305da1c47e626899ccb2a5c5759e0c3c Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Sat, 4 May 2024 18:50:03 +0200 Subject: [PATCH 1/2] Update library.cpp --- lib/library.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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") { From 455d6924162543f55e3349980fb81ca8b9bed4e7 Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Sat, 4 May 2024 19:59:36 +0200 Subject: [PATCH 2/2] const ref --- gui/resultstree.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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")) {