aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/builtins/buildenv.cc
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/libstore/builtins/buildenv.cc
parente6e61f0a54dac0174df996e93fcfedcac7769ab4 (diff)
OCD performance fix: {find,count}+insert => insert
Diffstat (limited to 'src/libstore/builtins/buildenv.cc')
-rw-r--r--src/libstore/builtins/buildenv.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libstore/builtins/buildenv.cc b/src/libstore/builtins/buildenv.cc
index 74e706664..096593886 100644
--- a/src/libstore/builtins/buildenv.cc
+++ b/src/libstore/builtins/buildenv.cc
@@ -123,8 +123,7 @@ static Path out;
static void addPkg(const Path & pkgDir, int priority)
{
- if (done.count(pkgDir)) return;
- done.insert(pkgDir);
+ if (!done.insert(pkgDir).second) return;
createLinks(pkgDir, out, priority);
try {