From a61841ac41646ad0345cef547facd2c20f1da957 Mon Sep 17 00:00:00 2001 From: Ben Burdette Date: Sat, 9 Apr 2022 07:45:23 -0600 Subject: [PATCH] don't use std::map merge --- src/libexpr/eval.cc | 9 +++------ 1 file 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); } }