From 07e4015687c52ded043345605b7c9426f1424c77 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 22 Jun 2020 18:34:45 +0200 Subject: [PATCH] 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 --- .../corelib/time/qtimezone/tst_bench_qtimezone.cpp | 7 ++----- 1 file 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 // Copyright (C) 2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure // 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 enoughZones() { #ifdef EXHAUSTIVE - auto available = QTimeZone::availableTimeZoneIds(); - QList result; - result.reserve(available.size() + 1); - for (conat auto &name : available) - result << name; + QList result = QTimeZone::availableTimeZoneIds(); #else QList result { QByteArray("UTC"),