qt5base-lts/tests/benchmarks/corelib
Marc Mutz 47375a213f QMimeDatabase benchmark: port away from Q_FOREACH
The original code duplicated contained elements of a QStringList by
repeated appending it to itself, preventing the container from being
marked const.

Instead, keep a list of unique mime-types, and iterate over the list
eight times.

As a drive-by, port from QList to a C array ("never use a
dynamically-sized container for statically-sized data"), use u""_s
UDLs (since we're touching almost all lines of the function, anyway,
also in the unrelated mimeTypeForName() call).

This allows porting the Q_FOREACH loop (which anyway cannot deal with
C arrays) to a ranged for one (which can).

Pick-to: 6.6 6.5
Task-number: QTBUG-115839
Change-Id: I844ae38104bb2980ea194b85f9017a3e95791ea2
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-08-14 23:11:54 +03:00
..
io tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
itemmodels QSortFilterProxyModel: port to PMF connects for performance reasons 2023-02-02 20:43:59 +01:00
json tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
kernel CMake: remove check for cxx11_future 2023-08-02 12:36:18 -07:00
mimetypes QMimeDatabase benchmark: port away from Q_FOREACH 2023-08-14 23:11:54 +03:00
plugin tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
text QByteArray: use new assign() in operator=(const char *) 2023-08-11 14:11:44 +02:00
thread Long live QtFuture::makeReadyVoidFuture() and QtFuture::makeReadyValueFuture() 2023-04-05 13:38:15 +02:00
time Simplify (and fix) initialization of a list of time-zones 2023-07-19 22:50:32 +02:00
tools tst_bench_QCryptographicHash: use resultView() 2023-03-31 10:32:45 +01:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00