Don't allocate unneeded temporary containers

Fix clazy warnings: allocating an unneeded temporary container
[clazy-container-anti-pattern]

Change-Id: I4b4c2c634eea650bbdf3c12d982a17f899fc94ec
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2020-12-08 15:41:46 +01:00
parent 93dd966ce2
commit cf010911f7
25 changed files with 118 additions and 93 deletions

View File

@@ -507,9 +507,10 @@ void TestResultsPane::initializeFilterMenu()
textAndType.insert(ResultType::MessageDebug, tr("Debug Messages"));
textAndType.insert(ResultType::MessageWarn, tr("Warning Messages"));
textAndType.insert(ResultType::MessageInternal, tr("Internal Messages"));
for (ResultType result : textAndType.keys()) {
for (auto it = textAndType.cbegin(); it != textAndType.cend(); ++it) {
const ResultType &result = it.key();
QAction *action = new QAction(m_filterMenu);
action->setText(textAndType.value(result));
action->setText(it.value());
action->setCheckable(true);
action->setChecked(result != ResultType::MessageInternal || !omitIntern);
action->setData(int(result));