diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-09-28 11:15:27 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-09-28 12:49:35 +0200 |
commit | 3eb9ee34c06d54ea21fedd3188c60e536a487b1c (patch) | |
tree | 57e530da7448b3d8284a198693437d9c764c9a3e /src/qml/qml | |
parent | 9ae856fe34c1cc47e76c408d29379e1f6869b434 (diff) |
qqmlimport: Use stable_partition instead of stable_sort
We do not actually need to sort the imports list, we just require that
all inline component imports come before all other imports.
This avoids triggering a MSVC STL debug assertion about the used Compare
function not actually creating a strict ordering.
Fixes: QTBUG-86989
Pick-to: 5.15
Change-Id: I381852392545287ec02b186fcb4f33be3ae95b33
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index c4ca167c85..961076abeb 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -1009,8 +1009,8 @@ bool QQmlImportNamespace::resolveType(QQmlTypeLoader *typeLoader, const QHashedS typeRecursionDetected = &localTypeRecursionDetected; if (needsSorting()) { - std::stable_sort(imports.begin(), imports.end(), [](QQmlImportInstance *left, QQmlImportInstance *) { - return left->isInlineComponent; + std::stable_partition(imports.begin(), imports.end(), [](QQmlImportInstance *import) { + return import->isInlineComponent; }); setNeedsSorting(false); } |