don't use std::map merge

This commit is contained in:
Ben Burdette 2022-04-09 07:45:23 -06:00
parent f5757a0804
commit a61841ac41

View file

@ -786,13 +786,12 @@ void mapStaticEnvBindings(const StaticEnv &se, const Env &env, valmap & vm)
if (env.up && se.up) { 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) if (env.type == Env::HasWithAttrs)
{ {
// add 'with' bindings. // add 'with' bindings.
Bindings::iterator j = env.values[0]->attrs->begin(); Bindings::iterator j = env.values[0]->attrs->begin();
while (j != env.values[0]->attrs->end()) { while (j != env.values[0]->attrs->end()) {
map[j->name] = j->value; vm[j->name] = j->value;
++j; ++j;
} }
} }
@ -801,11 +800,9 @@ void mapStaticEnvBindings(const StaticEnv &se, const Env &env, valmap & vm)
// iterate through staticenv bindings and add them. // iterate through staticenv bindings and add them.
for (auto iter = se.vars.begin(); iter != se.vars.end(); ++iter) 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);
} }
} }