summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin
diff options
context:
space:
mode:
authorTor Arne Vestbø <[email protected]>2024-06-20 15:16:01 +0200
committerTor Arne Vestbø <[email protected]>2024-06-21 02:18:53 +0200
commit67bf3f9625c50a2af2d79d85247c1eee5b727682 (patch)
tree60fb42fd8a76a2f33507dfcac477e780bbcb3b4b /src/corelib/plugin
parent319cca2e2b8679bc553e8ebf97505f0625ee1c94 (diff)
QFactoryLoader: Clarify how we track the prioritized library for a key
Assigning to a variable named `previous` to promote a library to be the current/prioritized library is needlessly obfuscated. Amends 6675e8c942c2f9797d66269368c729c5556528c2. Pick-to: 6.8 Change-Id: Ibdd48cbb5daba60c231f9f71133c3b58d32f7781 Reviewed-by: Marc Mutz <[email protected]>
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 6486414d8c1..d96ec80d397 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -368,13 +368,13 @@ inline void QFactoryLoaderPrivate::updateSinglePath(const QString &path)
// whereas the new one has a Qt version that fits
// better
constexpr int QtVersionNoPatch = QT_VERSION_CHECK(QT_VERSION_MAJOR, QT_VERSION_MINOR, 0);
- QLibraryPrivate *&previous = keyMap[key];
+ QLibraryPrivate *&keyMapEntry = keyMap[key];
int prev_qt_version = 0;
- if (previous)
- prev_qt_version = int(previous->metaData.value(QtPluginMetaDataKeys::QtVersion).toInteger());
+ if (keyMapEntry)
+ prev_qt_version = int(keyMapEntry->metaData.value(QtPluginMetaDataKeys::QtVersion).toInteger());
int qt_version = int(library->metaData.value(QtPluginMetaDataKeys::QtVersion).toInteger());
- if (!previous || (prev_qt_version > QtVersionNoPatch && qt_version <= QtVersionNoPatch)) {
- previous = library.get(); // we WILL .release()
+ if (!keyMapEntry || (prev_qt_version > QtVersionNoPatch && qt_version <= QtVersionNoPatch)) {
+ keyMapEntry = library.get(); // we WILL .release()
++keyUsageCount;
}
}