aboutsummaryrefslogtreecommitdiff
path: root/src/resolve-system-dependencies
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-10-09 15:51:52 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-10-09 16:06:29 +0200
commit99b73fb5071db9fd757c9927fc3fde34e2abac63 (patch)
treefb50f681aced9f566da52aaf22eb4275471d010a /src/resolve-system-dependencies
parente6e61f0a54dac0174df996e93fcfedcac7769ab4 (diff)
OCD performance fix: {find,count}+insert => insert
Diffstat (limited to 'src/resolve-system-dependencies')
-rw-r--r--src/resolve-system-dependencies/resolve-system-dependencies.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/resolve-system-dependencies/resolve-system-dependencies.cc b/src/resolve-system-dependencies/resolve-system-dependencies.cc
index e02cfc03e..45e8b6796 100644
--- a/src/resolve-system-dependencies/resolve-system-dependencies.cc
+++ b/src/resolve-system-dependencies/resolve-system-dependencies.cc
@@ -117,9 +117,7 @@ Path resolveSymlink(const Path & path)
std::set<string> resolveTree(const Path & path, PathSet & deps)
{
std::set<string> results;
- if (deps.count(path))
- return {};
- deps.insert(path);
+ if (!deps.insert(path).second) return {};
for (auto & lib : runResolver(path)) {
results.insert(lib);
for (auto & p : resolveTree(lib, deps)) {