summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Kling <andreas.kling@nokia.com>2011-03-15 13:42:03 (GMT)
committerAndreas Kling <andreas.kling@nokia.com>2011-03-15 15:50:20 (GMT)
commit3dd9e6a40bc4131ebc35d367af69fd9197e19344 (patch)
tree5f6f30dd2429d6c9bd80c5b2e3ac7acde2157c9a
parent8e6df3ec44a87952817d766253c8f93adc8514a4 (diff)
downloadQt-3dd9e6a40bc4131ebc35d367af69fd9197e19344.zip
Qt-3dd9e6a40bc4131ebc35d367af69fd9197e19344.tar.gz
Qt-3dd9e6a40bc4131ebc35d367af69fd9197e19344.tar.bz2
Option::fixString: Avoid double hash lookups for cache hits.
Reviewed-by: Oswald Buddenhagen
-rw-r--r--qmake/option.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/qmake/option.cpp b/qmake/option.cpp
index fcbf5fa..28b764a 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -624,10 +624,12 @@ Option::fixString(QString string, uchar flags)
qmakeAddCacheClear(qmakeDeleteCacheClear<QHash<FixStringCacheKey, QString> >, (void**)&cache);
}
FixStringCacheKey cacheKey(string, flags);
- if(cache->contains(cacheKey)) {
- const QString ret = cache->value(cacheKey);
- //qDebug() << "Fix (cached) " << orig_string << "->" << ret;
- return ret;
+
+ QHash<FixStringCacheKey, QString>::const_iterator it = cache->constFind(cacheKey);
+
+ if (it != cache->constEnd()) {
+ //qDebug() << "Fix (cached) " << orig_string << "->" << it.value();
+ return it.value();
}
//fix the environment variables