aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/attr-set.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/attr-set.hh')
-rw-r--r--src/libexpr/attr-set.hh6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libexpr/attr-set.hh b/src/libexpr/attr-set.hh
index d6af99912..118c7bd5d 100644
--- a/src/libexpr/attr-set.hh
+++ b/src/libexpr/attr-set.hh
@@ -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]; }