Avoid creation of temporary containers

This commit is contained in:
Gianluca Recchia 2019-01-17 07:23:22 +01:00 committed by Jonathan White
parent 39b96c13e8
commit 2cf837801d
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
6 changed files with 15 additions and 7 deletions

View file

@ -616,7 +616,8 @@ Merger::ChangeList Merger::mergeMetadata(const MergeContext& context)
auto* sourceMetadata = context.m_sourceDb->metadata();
auto* targetMetadata = context.m_targetDb->metadata();
for (QUuid customIconId : sourceMetadata->customIcons().keys()) {
const auto keys = sourceMetadata->customIcons().keys();
for (QUuid customIconId : keys) {
QImage customIcon = sourceMetadata->customIcon(customIconId);
if (!targetMetadata->containsCustomIcon(customIconId)) {
targetMetadata->addCustomIcon(customIconId, customIcon);