aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/attr-set.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-04-26 13:23:32 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-04-26 13:25:17 +0200
commitfab731a9d4622b1ecd7dea01895d9fbaf83301ea (patch)
treed89fbd645c8961a5bd079eef2cc1e54c84784cd2 /src/libexpr/attr-set.cc
parent29e52194a8492d9eea8f7425ea0a2660cfdb6aef (diff)
Don't pass Symbol by reference
Since Symbol is just an integer, passing it by const reference is never advantageous.
Diffstat (limited to 'src/libexpr/attr-set.cc')
-rw-r--r--src/libexpr/attr-set.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libexpr/attr-set.cc b/src/libexpr/attr-set.cc
index 61996eae4..877116f1f 100644
--- a/src/libexpr/attr-set.cc
+++ b/src/libexpr/attr-set.cc
@@ -26,7 +26,7 @@ Bindings * EvalState::allocBindings(size_t capacity)
/* Create a new attribute named 'name' on an existing attribute set stored
in 'vAttrs' and return the newly allocated Value which is associated with
this attribute. */
-Value * EvalState::allocAttr(Value & vAttrs, const Symbol & name)
+Value * EvalState::allocAttr(Value & vAttrs, Symbol name)
{
Value * v = allocValue();
vAttrs.attrs->push_back(Attr(name, v));
@@ -40,7 +40,7 @@ Value * EvalState::allocAttr(Value & vAttrs, std::string_view name)
}
-Value & BindingsBuilder::alloc(const Symbol & name, PosIdx pos)
+Value & BindingsBuilder::alloc(Symbol name, PosIdx pos)
{
auto value = state.allocValue();
bindings->push_back(Attr(name, value, pos));