diff options
author | Katja Marttila <katja.marttila@qt.io> | 2022-06-21 13:07:05 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2022-06-22 14:03:58 +0300 |
commit | 625c7ea707c1dd097e1bb8862dc4e35a12976c19 (patch) | |
tree | 9dec1026fa82a77e8276d323a1d14916d35859c5 | |
parent | 62fff00e0336db78d1fc9632d72293bf8928645b (diff) |
Fix unnecessary QSet transform
Change-Id: I67ebe6970a54fad9d8c5fcea91b726fb140d6dc3
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
-rw-r--r-- | src/libs/installer/installercalculator.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libs/installer/installercalculator.cpp b/src/libs/installer/installercalculator.cpp index e321872ee..9f8293545 100644 --- a/src/libs/installer/installercalculator.cpp +++ b/src/libs/installer/installercalculator.cpp @@ -107,9 +107,7 @@ bool InstallerCalculator::appendComponentsToInstall(const QList<Component *> &co // user explicitly selects it to install. Increase the references to // know when the component should be removed from install const QStringList dependenciesList = component->currentDependencies(); - QSet<QString> allDependencies(dependenciesList.begin(), dependenciesList.end()); - - foreach (const QString &dependencyComponentName, allDependencies) + for (const QString &dependencyComponentName : dependenciesList) calculateComponentDependencyReferences(dependencyComponentName, component); continue; } @@ -184,9 +182,8 @@ void InstallerCalculator::realAppendToInstallComponents(Component *component, co bool InstallerCalculator::appendComponentToInstall(Component *component, const QString &version, bool revertFromInstall) { const QStringList dependenciesList = component->currentDependencies(); - const QSet<QString> allDependencies(dependenciesList.begin(), dependenciesList.end()); QString requiredDependencyVersion = version; - foreach (const QString &dependencyComponentName, allDependencies) { + for (const QString &dependencyComponentName : dependenciesList) { // PackageManagerCore::componentByName returns 0 if dependencyComponentName contains a // version which is not available Component *dependencyComponent = @@ -345,8 +342,7 @@ void InstallerCalculator::calculateComponentDependencyReferences(const QString d m_referenceCount.insert(dependencyComponentName, value); const QStringList dependenciesList = dependencyComponent->currentDependencies(); - QSet<QString> allDependencies(dependenciesList.begin(), dependenciesList.end()); - for (const QString &depComponentName : allDependencies) { + for (const QString &depComponentName : dependenciesList) { Component *dependencyComponent = PackageManagerCore::componentByName(depComponentName, m_allComponents); calculateComponentDependencyReferences(depComponentName, dependencyComponent); |