1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Don't pass Symbol by reference

Since Symbol is just an integer, passing it by const reference is
never advantageous.
This commit is contained in:
Eelco Dolstra 2022-04-26 13:23:32 +02:00
parent 29e52194a8
commit fab731a9d4
4 changed files with 13 additions and 12 deletions

View file

@ -66,7 +66,7 @@ public:
attrs[size_++] = attr;
}
iterator find(const Symbol & name)
iterator find(Symbol name)
{
Attr key(name, 0);
iterator i = std::lower_bound(begin(), end(), key);
@ -74,7 +74,7 @@ public:
return end();
}
Attr * get(const Symbol & name)
Attr * get(Symbol name)
{
Attr key(name, 0);
iterator i = std::lower_bound(begin(), end(), key);
@ -143,7 +143,7 @@ public:
bindings->push_back(attr);
}
Value & alloc(const Symbol & name, PosIdx pos = noPos);
Value & alloc(Symbol name, PosIdx pos = noPos);
Value & alloc(std::string_view name, PosIdx pos = noPos);