1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 05:01:48 +02:00

OCD performance fix: {find,count}+insert => insert

This commit is contained in:
Eelco Dolstra 2019-10-09 15:51:52 +02:00
parent e6e61f0a54
commit 99b73fb507
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
16 changed files with 32 additions and 65 deletions

View file

@ -242,11 +242,10 @@ const string treeNull = " ";
static void printTree(const Path & path,
const string & firstPad, const string & tailPad, PathSet & done)
{
if (done.find(path) != done.end()) {
if (!done.insert(path).second) {
cout << format("%1%%2% [...]\n") % firstPad % path;
return;
}
done.insert(path);
cout << format("%1%%2%\n") % firstPad % path;