QFactoryLoader: port a local QStringList to QDuplicateTracker
Apart from a more fitting, minimal, API, QDuplicateTracker also transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or at least reduce, memory allocations. Change-Id: I0a0d1e31fd35d483e0036045847a3759b593c71c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>bb10
parent
1cd7cbf617
commit
1f3cf206f4
|
|
@ -57,6 +57,7 @@
|
|||
#include "qjsonvalue.h"
|
||||
#include "qjsonobject.h"
|
||||
#include "qjsonarray.h"
|
||||
#include "private/qduplicatetracker_p.h"
|
||||
|
||||
#include <qtcore_tracepoints_p.h>
|
||||
|
||||
|
|
@ -165,7 +166,7 @@ public:
|
|||
QMap<QString,QLibraryPrivate*> keyMap;
|
||||
QString suffix;
|
||||
Qt::CaseSensitivity cs;
|
||||
QStringList loadedPaths;
|
||||
QDuplicateTracker<QString> loadedPaths;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
@ -192,9 +193,8 @@ void QFactoryLoader::update()
|
|||
for (int i = 0; i < paths.count(); ++i) {
|
||||
const QString &pluginDir = paths.at(i);
|
||||
// Already loaded, skip it...
|
||||
if (d->loadedPaths.contains(pluginDir))
|
||||
if (d->loadedPaths.hasSeen(pluginDir))
|
||||
continue;
|
||||
d->loadedPaths << pluginDir;
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
QString path = pluginDir;
|
||||
|
|
|
|||
Loading…
Reference in New Issue