diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2025-07-30 08:50:50 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2025-08-02 17:47:29 +0000 |
| commit | afc961269971d8ecd69f44b41e9fde03b42d440f (patch) | |
| tree | 597a0311ea65ded3f441b2f299947a559882c00b /src/corelib/thread/qthreadpool.cpp | |
| parent | 27230157212c32420e71b28870d6c77630c3dc37 (diff) | |
QLocale/Win: fix spurious spaces in windows_to_iso_list entries
For some reason, iso_name values shorter than the maximum of five
characters (excluding the terminating null) were "propped up" using an
explicit embedded \0 and two spaces.
This is weird, because it's extra work compared to the default of just
writing the shorter string literal and letting the compiler fill the
rest with null characters.
It also prevents use of memcmp() in lieu of strcmp(), because while
the spaces following \0 are "invisible" to strcmp(), they'd be visible
to memcmp().
Change such entries to use the shorter canonical form.
This enables the use of memcmp() instead of strcmp(), because both
buffers (the one in the table, and qt_inIsoNametoLCID()::n) are now
zero-extended (the former by the compiler and the latter by
strncpy()).
Even if we compare strictly more characters now (strcmp() would have
stopped at the first embedded null, memcmp() keeps going), the small
size of the buffers and the constant length of the range make this
potentially much faster.
Amends the start of the public history (for the format of the table).
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Id760fba81f28710f0ee19a303426f3706c00dad6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/corelib/thread/qthreadpool.cpp')
0 files changed, 0 insertions, 0 deletions
