mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Inline Bindings::find()
This commit is contained in:
parent
5b58991a71
commit
93e4f01ee3
2 changed files with 8 additions and 10 deletions
|
@ -32,15 +32,6 @@
|
|||
namespace nix {
|
||||
|
||||
|
||||
Bindings::iterator Bindings::find(const Symbol & name)
|
||||
{
|
||||
Attr key(name, 0);
|
||||
iterator i = std::lower_bound(begin(), end(), key);
|
||||
if (i != end() && i->name == name) return i;
|
||||
return end();
|
||||
}
|
||||
|
||||
|
||||
void Bindings::sort()
|
||||
{
|
||||
std::sort(begin(), end());
|
||||
|
|
|
@ -57,7 +57,14 @@ public:
|
|||
attrs[size_++] = attr;
|
||||
}
|
||||
|
||||
iterator find(const Symbol & name);
|
||||
iterator find(const Symbol & name)
|
||||
{
|
||||
Attr key(name, 0);
|
||||
iterator i = std::lower_bound(begin(), end(), key);
|
||||
if (i != end() && i->name == name) return i;
|
||||
return end();
|
||||
}
|
||||
|
||||
iterator begin() { return &attrs[0]; }
|
||||
iterator end() { return &attrs[size_]; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue