QLocale: replace a QList with QVLA for duplicate tracking
An alternative would have been QDuplicateTracker, but the maximum number of entries in the tracker is statically limited to six, so we don't need a fancy hash table, linear scan is good enough. Pick-to: 6.3 Change-Id: I8ca97d239723b51892cb13a43b1d1a6412faa561 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>bb10
parent
d13ee2dc1a
commit
096e8b5f65
|
|
@ -65,6 +65,7 @@ QT_WARNING_DISABLE_GCC("-Wfree-nonheap-object") // false positive tracking
|
|||
#include "qdatetime.h"
|
||||
#include "qstringlist.h"
|
||||
#include "qvariant.h"
|
||||
#include "qvarlengtharray.h"
|
||||
#include "qstringbuilder.h"
|
||||
#include "private/qnumeric_p.h"
|
||||
#include <cmath>
|
||||
|
|
@ -502,7 +503,7 @@ int QLocaleData::findLocaleIndex(QLocaleId lid)
|
|||
int index = findLocaleIndexById(likelyId);
|
||||
if (index >= 0)
|
||||
return index;
|
||||
QList<QLocaleId> tried;
|
||||
QVarLengthArray<QLocaleId, 6> tried;
|
||||
tried.push_back(likelyId);
|
||||
|
||||
#define CheckCandidate(id) do { \
|
||||
|
|
|
|||
Loading…
Reference in New Issue