From 2650518990c4f9b87fb429be00fdb5baecb9c411 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 16 Feb 2016 18:54:41 +0100 Subject: [PATCH] Reduce map look-ups --- containments/homescreen/applicationlistmodel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/containments/homescreen/applicationlistmodel.cpp b/containments/homescreen/applicationlistmodel.cpp index 7313a9ce..289146c5 100644 --- a/containments/homescreen/applicationlistmodel.cpp +++ b/containments/homescreen/applicationlistmodel.cpp @@ -136,8 +136,9 @@ void ApplicationListModel::loadApplications() data.storageId = service->storageId(); data.entryPath = service->exec(); - if (m_appPositions.contains(service->storageId())) { - orderedList[m_appPositions.value(service->storageId())] = data; + auto it = m_appPositions.constFind(service->storageId()); + if (it != m_appPositions.constEnd()) { + orderedList[*it] = data; } else { unorderedList << data; }