mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 11:21:15 -03:00
Another fish var performance improvement
Make setting fish vars more efficient by avoiding creating a wcstring_list_t for the case where we're setting one value. For the case where we're passing a list of values swap it with the list in the var rather than copying it. This makes the benchmark in #4200 approximately 6% faster.
This commit is contained in:
@@ -645,7 +645,8 @@ 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);
|
||||
env_set(var_name_prefix + opt_spec->short_flag, ENV_LOCAL, opt_spec->vals,
|
||||
opt_spec->long_flag.empty());
|
||||
}
|
||||
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