PerformScan: Eliminate foundMatches
Erase elements from matches and test that it's not empty instead of
compiling a new foundMatches list only to compare their sizes.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I4d88ff872accef03d3b08670f388d2a94c44524e
diff --git a/src/PerformScan.cpp b/src/PerformScan.cpp
index ec2ad40..80f56b8 100644
--- a/src/PerformScan.cpp
+++ b/src/PerformScan.cpp
@@ -539,7 +539,6 @@
continue;
}
- std::set<std::string> foundMatches;
for (auto& [configId, config] :
_systemConfiguration.items())
{
@@ -569,7 +568,7 @@
continue;
}
- foundMatches.insert(**match);
+ matches.erase(*match);
if (isBind)
{
@@ -585,7 +584,7 @@
}
}
}
- if (foundMatches.size() != matches.size())
+ if (!matches.empty())
{
std::cerr << "configuration file "
"dependency error, "