mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 06:52:43 +01:00
OCD performance fix: {find,count}+insert => insert
This commit is contained in:
parent
e6e61f0a54
commit
99b73fb507
16 changed files with 32 additions and 65 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue