mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
env: Use preexisting_flags to determine pathiness
We've already checked if the variable exists above, and we've already gotten the preexisting_flags, so we can just use them. Saves a lookup.
This commit is contained in:
parent
9afc4b419e
commit
a7ec158373
1 changed files with 2 additions and 2 deletions
|
@ -1147,8 +1147,8 @@ static int env_set_internal(const wcstring &key, env_mode_flags_t input_var_mode
|
|||
// If there's an existing variable, use its path flag; otherwise infer it.
|
||||
if ((var_mode & (ENV_PATHVAR | ENV_UNPATHVAR)) == 0) {
|
||||
bool should_pathvar = false;
|
||||
if (auto existing = node->find_entry(key)) {
|
||||
should_pathvar = existing->is_pathvar();
|
||||
if (preexisting_flags) {
|
||||
should_pathvar = *preexisting_flags & env_var_t::flag_pathvar;
|
||||
} else {
|
||||
should_pathvar = variable_should_auto_pathvar(key);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue