Calling values and then foreach on a QHash is slower and more memory intensive than just foreach the QHash, this changes the first to the second.

Acked by Chani

svn path=/trunk/KDE/kdelibs/; revision=1111048
This commit is contained in:
Albert Astals Cid 2010-04-04 18:15:51 +00:00
parent 8a9603eec6
commit 8de16871a6

View File

@ -656,14 +656,14 @@ void RunnerManager::launchQuery(const QString &untrimmedTerm, const QString &run
// kDebug() << "runners searching for" << term << "on" << runnerName;
d->context.setQuery(term);
AbstractRunner::List runable;
QHash<QString, AbstractRunner*> runable;
//if the name is not empty we will launch only the specified runner
if (d->singleMode && d->currentSingleRunner) {
runable.append(d->currentSingleRunner);
runable.insert(QString(), d->currentSingleRunner);
d->context.setSingleRunnerQueryMode(true);
} else {
runable = d->runners.values();
runable = d->runners;
}
foreach (Plasma::AbstractRunner *r, runable) {