mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 04:41:14 -03:00
Use move semantics instead of swap in env_set
This commit backs out certain optimizations around setting environment variables, and replaces them with move semantics. env_set accepts a list, by value, permitting callers to use std::move to transfer ownership.
This commit is contained in:
@@ -652,8 +652,7 @@ static void set_argparse_result_vars(argparse_cmd_opts_t &opts) {
|
||||
if (!opt_spec->num_seen) continue;
|
||||
|
||||
if (opt_spec->short_flag_valid) {
|
||||
env_set(var_name_prefix + opt_spec->short_flag, ENV_LOCAL, opt_spec->vals,
|
||||
opt_spec->long_flag.empty());
|
||||
env_set(var_name_prefix + opt_spec->short_flag, ENV_LOCAL, opt_spec->vals);
|
||||
}
|
||||
if (!opt_spec->long_flag.empty()) {
|
||||
// We do a simple replacement of all non alphanum chars rather than calling
|
||||
|
||||
Reference in New Issue
Block a user