diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2025-08-01 09:23:59 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2025-08-01 18:47:43 +0000 |
| commit | 7530a86df81b60621eb0813fba684d618060f1ad (patch) | |
| tree | 21d6fc2bbbd516391188d0eb2075f8718601fe8e /src/widgets/doc/snippets/cmake-macros/examples.cpp | |
| parent | d08c7d9c9789a7e017b27a3f1451559fe1aee945 (diff) | |
QLocale: fix quadratic reimplementation of QStringList::removeDuplicates()
The old code didn't use QStringList::removeDuplicates(), because it
still needs the QDuplicateTracker for later. It, however, used a loop
around erase(it) (or Qt's equivalent for indexed loops), which makes
the loop have quadratic complexity, instead of std::remove_if(),
which is linear.
Fix by using QList::removeIf() instead (which is std::remove_if()).
There are more insertion-in-the-middle problems in this function,
filed QTBUG-138851 so they're not forgotten.
Amends 2c39365aad957aea7ca9c9c861665391edf7ef23, though I'm sure the
old code had a similar problem, just buried deeper. This patch won't
apply there.
Task-number: QTBUG-138851
Pick-to: 6.10 6.9
Change-Id: I5748822bd99dac7cdbd2c1deaec348a82194e994
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/widgets/doc/snippets/cmake-macros/examples.cpp')
0 files changed, 0 insertions, 0 deletions
