1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 11:43:15 +02:00

Merge remote-tracking branch 'origin/master' into flakes

This commit is contained in:
Eelco Dolstra 2020-02-14 22:42:35 +01:00
commit 6208d24c38
7 changed files with 13 additions and 16 deletions

View file

@ -64,12 +64,12 @@ public:
return end();
}
std::optional<Attr *> get(const Symbol & name)
Attr * get(const Symbol & name)
{
Attr key(name, 0);
iterator i = std::lower_bound(begin(), end(), key);
if (i != end() && i->name == name) return &*i;
return {};
return nullptr;
}
Attr & need(const Symbol & name, const Pos & pos = noPos)
@ -77,7 +77,7 @@ public:
auto a = get(name);
if (!a)
throw Error("attribute '%s' missing, at %s", name, pos);
return **a;
return *a;
}
iterator begin() { return &attrs[0]; }