mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 23:12:44 +01:00
Merge remote-tracking branch 'origin/master' into precise-gc
This commit is contained in:
commit
c31b3d6c5c
1 changed files with 3 additions and 3 deletions
|
|
@ -69,12 +69,12 @@ public:
|
||||||
return end();
|
return end();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<Attr *> get(const Symbol & name)
|
Attr * get(const Symbol & name)
|
||||||
{
|
{
|
||||||
Attr key(name, 0);
|
Attr key(name, 0);
|
||||||
iterator i = std::lower_bound(begin(), end(), key);
|
iterator i = std::lower_bound(begin(), end(), key);
|
||||||
if (i != end() && i->name == name) return &*i;
|
if (i != end() && i->name == name) return &*i;
|
||||||
return {};
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Attr & need(const Symbol & name, const Pos & pos = noPos)
|
Attr & need(const Symbol & name, const Pos & pos = noPos)
|
||||||
|
|
@ -82,7 +82,7 @@ public:
|
||||||
auto a = get(name);
|
auto a = get(name);
|
||||||
if (!a)
|
if (!a)
|
||||||
throw Error("attribute '%s' missing, at %s", name, pos);
|
throw Error("attribute '%s' missing, at %s", name, pos);
|
||||||
return **a;
|
return *a;
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator begin() { return &attrs[0]; }
|
iterator begin() { return &attrs[0]; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue