mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 09:12:11 +08:00
Remove std::move blocking potential copy elision
This commit is contained in:
parent
5c22be518b
commit
f5b431c21b
@ -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…
x
Reference in New Issue
Block a user