aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/references.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/references.cc
parente6e61f0a54dac0174df996e93fcfedcac7769ab4 (diff)
OCD performance fix: {find,count}+insert => insert
Diffstat (limited to 'src/libstore/references.cc')
-rw-r--r--src/libstore/references.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libstore/references.cc b/src/libstore/references.cc
index 5b7eb1f84..0dcc264c3 100644
--- a/src/libstore/references.cc
+++ b/src/libstore/references.cc
@@ -36,11 +36,10 @@ static void search(const unsigned char * s, size_t len,
}
if (!match) continue;
string ref((const char *) s + i, refLength);
- if (hashes.find(ref) != hashes.end()) {
+ if (hashes.erase(ref)) {
debug(format("found reference to '%1%' at offset '%2%'")
% ref % i);
seen.insert(ref);
- hashes.erase(ref);
}
++i;
}