From b39522f874f6a1c493eb1633808baa1e3e20ae50 Mon Sep 17 00:00:00 2001 From: Gianluca Recchia Date: Wed, 31 Oct 2018 18:23:42 +0100 Subject: [PATCH] Avoid allocating temporary containers --- src/core/Group.cpp | 2 +- src/core/Merger.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Group.cpp b/src/core/Group.cpp index 68c2bcf47..2051fe437 100644 --- a/src/core/Group.cpp +++ b/src/core/Group.cpp @@ -983,7 +983,7 @@ QStringList Group::locate(const QString& locateTerm, const QString& currentPath) for (const Entry* entry : asConst(m_entries)) { QString entryPath = currentPath + entry->title(); - if (entryPath.toLower().contains(locateTerm.toLower())) { + if (entryPath.contains(locateTerm, Qt::CaseInsensitive)) { response << entryPath; } } diff --git a/src/core/Merger.cpp b/src/core/Merger.cpp index 2bdff7377..0da7458ea 100644 --- a/src/core/Merger.cpp +++ b/src/core/Merger.cpp @@ -480,7 +480,7 @@ bool Merger::mergeHistory(const Entry* sourceEntry, Entry* targetEntry, Group::M bool updateTimeInfo = targetEntry->canUpdateTimeinfo(); targetEntry->setUpdateTimeinfo(false); targetEntry->removeHistoryItems(targetHistoryItems); - for (Entry* historyItem : merged.values()) { + for (Entry* historyItem : merged) { Q_ASSERT(!historyItem->parent()); targetEntry->addHistoryItem(historyItem); }