mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-20 14:11:14 -03:00
Stop using env_var_t::to_list in a few places
We don't need the entire list in modifiable form here - some just needs the size, the others can just get a reference.
This commit is contained in:
@@ -138,8 +138,9 @@ wcstring_list_t path_get_paths(const wcstring &cmd, const environment_t &vars) {
|
||||
}
|
||||
|
||||
auto path_var = vars.get(L"PATH");
|
||||
wcstring_list_t pathsv;
|
||||
if (path_var) path_var->to_list(pathsv);
|
||||
if (!path_var) return paths;
|
||||
|
||||
const wcstring_list_t &pathsv = path_var->as_list();
|
||||
for (auto path : pathsv) {
|
||||
if (path.empty()) continue;
|
||||
append_path_component(path, cmd);
|
||||
|
||||
Reference in New Issue
Block a user