35 lines
1.2 KiB
Diff
35 lines
1.2 KiB
Diff
# UNDF: UNDF-2026-000001068
|
|
# UNDF:
|
|
--- a/Source/cmQtAutoGen.cxx
|
|
+++ b/Source/cmQtAutoGen.cxx
|
|
@@ -25,6 +25,7 @@ static void MergeOptions(std::vector<std::string>& baseOpts,
|
|
bool isQt5OrLater)
|
|
{
|
|
if (newOpts.empty()) {
|
|
return;
|
|
}
|
|
if (baseOpts.empty()) {
|
|
baseOpts = newOpts;
|
|
return;
|
|
}
|
|
|
|
std::vector<std::string> extraOpts;
|
|
+ // Build a hash set for O(1) membership lookup instead of O(M) linear scan.
|
|
+ std::unordered_set<std::string> baseOptsSet(baseOpts.begin(), baseOpts.end());
|
|
for (auto fit = newOpts.begin(), fitEnd = newOpts.end(); fit != fitEnd;
|
|
++fit) {
|
|
std::string const& newOpt = *fit;
|
|
- auto existIt = std::find(baseOpts.begin(), baseOpts.end(), newOpt);
|
|
- if (existIt != baseOpts.end()) {
|
|
+ if (baseOptsSet.count(newOpt)) {
|
|
+ auto existIt = std::find(baseOpts.begin(), baseOpts.end(), newOpt);
|
|
if (newOpt.size() >= 2) {
|
|
// Acquire the option name
|
|
std::string optName;
|
|
--- a/Source/cmQtAutoGen.cxx
|
|
+++ b/Source/cmQtAutoGen.cxx
|
|
@@ -1,6 +1,7 @@
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
file LICENSE.rst or https://cmake.org/licensing for details. */
|
|
#include "cmQtAutoGen.h"
|
|
+#include <unordered_set>
|