diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-06-22 18:34:45 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-07-19 22:50:32 +0200 |
commit | 07e4015687c52ded043345605b7c9426f1424c77 (patch) | |
tree | 3e51e49928230b1123577955a56dde5cf6b779f7 /tests/benchmarks/corelib/time | |
parent | f8e1194aefc1ad7119f4d08bd82d4c3c1cd6500e (diff) |
Simplify (and fix) initialization of a list of time-zones
Looping over the entries had a typo in it and was quite unnecessary,
as it just made a fresh copy of a list we already had.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I0f3023b06163e5854d425d816e465785cda5fc91
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'tests/benchmarks/corelib/time')
-rw-r--r-- | tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp b/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp index 0cd4065824..870f5f4bd8 100644 --- a/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp +++ b/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2022 The Qt Company Ltd. // Copyright (C) 2019 Crimson AS <info@crimson.no> // Copyright (C) 2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 @@ -29,11 +30,7 @@ private Q_SLOTS: static QList<QByteArray> enoughZones() { #ifdef EXHAUSTIVE - auto available = QTimeZone::availableTimeZoneIds(); - QList<QByteArray> result; - result.reserve(available.size() + 1); - for (conat auto &name : available) - result << name; + QList<QByteArray> result = QTimeZone::availableTimeZoneIds(); #else QList<QByteArray> result { QByteArray("UTC"), |