summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-12-25 18:57:42 +0100
committerMarc Mutz <marc.mutz@kdab.com>2015-12-29 19:02:11 +0000
commitdb0453742c7b156ce1d133d7c2c3c5959ff0c9e6 (patch)
treedbbda014a3d1e66d9633e8be759e029051bd98c8 /src/corelib
parentc6177dcccf73427b75b1f1efe80317b7f4fdddc9 (diff)
QTimeZone: don't iterate over QHash::keys()
... iterate over the hash directly. Prevents hash lookups and the creation of a temporary QList. Saves over 376b in text size on optimized GCC 4.9 Linux AMD64 builds. Change-Id: I7f1a22da33b94bc91bec89f62c471f8279a5d702 Reviewed-by: Sérgio Martins <iamsergio@gmail.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qtimezoneprivate_tz.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
index 85ed345869..4bb52a8d8a 100644
--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
+++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
@@ -983,9 +983,9 @@ QList<QByteArray> QTzTimeZonePrivate::availableTimeZoneIds(QLocale::Country coun
{
// TODO AnyCountry
QList<QByteArray> result;
- foreach (const QByteArray &key, tzZones->keys()) {
- if (tzZones->value(key).country == country)
- result << key;
+ for (auto it = tzZones->cbegin(), end = tzZones->cend(); it != end; ++it) {
+ if (it.value().country == country)
+ result << it.key();
}
std::sort(result.begin(), result.end());
return result;