Remove std::move blocking potential copy elision

This commit is contained in:
Mahmoud Al-Qudsi 2020-06-28 18:08:13 -05:00
parent 5c22be518b
commit f5b431c21b

View file

@ -635,7 +635,9 @@ std::shared_ptr<const null_terminated_array_t<char>> env_scoped_impl_t::create_e
assert(var && "Variable should be present in uvars");
// Note that std::map::insert does NOT overwrite a value already in the map,
// which we depend on here.
vals.insert(std::move(std::make_pair(std::move(key), std::move(*var))));
// Note: Using std::move around make_pair prevents the compiler from implementing
// copy elision.
vals.insert(std::make_pair(std::move(key), std::move(*var)));
}
}