Avoid allocating temporary containers

This commit is contained in:
Gianluca Recchia 2018-10-31 18:23:42 +01:00 committed by Jonathan White
parent 49b82ea6a2
commit b39522f874
No known key found for this signature in database
GPG Key ID: 440FC65F2E0C6E01
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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);
}