diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2023-08-08 10:02:46 +0200 |
|---|---|---|
| committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-08-14 23:11:54 +0300 |
| commit | 47375a213f0751b5649ee7c4ae47fae020f9c77f (patch) | |
| tree | 6d83d5db68e32d66e7186888187322b24676a40b /src/corelib/plugin/quuid.cpp | |
| parent | 40afcb9d01713c02737f6f83a59437fc8320ef0b (diff) | |
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>
Diffstat (limited to 'src/corelib/plugin/quuid.cpp')
0 files changed, 0 insertions, 0 deletions
