mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 01:17:45 +00:00
Remove std::move blocking potential copy elision
This commit is contained in:
parent
5c22be518b
commit
f5b431c21b
1 changed files with 3 additions and 1 deletions
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue