aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2022-04-09 07:45:23 -0600
committerBen Burdette <bburdette@gmail.com>2022-04-09 07:45:23 -0600
commita61841ac41646ad0345cef547facd2c20f1da957 (patch)
tree30c6f1d9f0b4cdc9f65e6e01696e53498c56b9b2 /src
parentf5757a0804e0278e1ad2ac7a46adeb3dc96ce034 (diff)
don't use std::map merge
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/eval.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 914739f70..876bf8f37 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -784,15 +784,14 @@ void mapStaticEnvBindings(const StaticEnv &se, const Env &env, valmap & vm)
// override the higher levels.
// The top level bindings (builtins) are skipped since they are added for us by initEnv()
if (env.up && se.up) {
- mapStaticEnvBindings(*se.up, *env.up,vm);
+ mapStaticEnvBindings(*se.up, *env.up, vm);
- auto map = valmap();
if (env.type == Env::HasWithAttrs)
{
// add 'with' bindings.
Bindings::iterator j = env.values[0]->attrs->begin();
while (j != env.values[0]->attrs->end()) {
- map[j->name] = j->value;
+ vm[j->name] = j->value;
++j;
}
}
@@ -801,11 +800,9 @@ void mapStaticEnvBindings(const StaticEnv &se, const Env &env, valmap & vm)
// iterate through staticenv bindings and add them.
for (auto iter = se.vars.begin(); iter != se.vars.end(); ++iter)
{
- map[iter->first] = env.values[iter->second];
+ vm[iter->first] = env.values[iter->second];
}
}
-
- vm.merge(map);
}
}