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>
bb10
Marc Mutz 2015-12-25 18:57:42 +01:00
parent c6177dcccf
commit db0453742c
1 changed files with 3 additions and 3 deletions

View File

@ -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;