Speed up cache lookups
Use constFind and an iterator to save one hash key lookup. CCMAIL:aleixpol@kde.org
This commit is contained in:
parent
1a55ac0c8c
commit
01d1509c7c
|
@ -239,8 +239,11 @@ void ThemePrivate::onAppExitCleanup()
|
|||
|
||||
QString ThemePrivate::findInTheme(const QString &image, const QString &theme, bool cache)
|
||||
{
|
||||
if (cache && discoveries.contains(image)) {
|
||||
return discoveries.value(image);
|
||||
if (cache) {
|
||||
auto it = discoveries.constFind(image);
|
||||
if (it != discoveries.constEnd()) {
|
||||
return it.value();
|
||||
}
|
||||
}
|
||||
|
||||
QString search;
|
||||
|
|
Loading…
Reference in New Issue
Block a user