From: sev Date: Mon, 14 Oct 2024 23:34:18 +0000 (-0500) Subject: zshenv: path performance micro optimization X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/commitdiff_plain/6cdc3a165e054a5cbefd42398def74f930ba9b13?ds=inline zshenv: path performance micro optimization --- diff --git a/etc/zsh/.zshenv b/etc/zsh/.zshenv index 922314f..b1ae0fd 100644 --- a/etc/zsh/.zshenv +++ b/etc/zsh/.zshenv @@ -80,8 +80,8 @@ function _sev_setpath { # emulate Arch Linux flatpak-bindir.sh for use on other systems {${XDG_DATA_HOME:-~/.local/share},{$PREFIX,}/var/lib}/flatpak/exports/bin) local -i i len=$#path - path=("$path[@]" "$syspath[@]") - # remove bad paths + path+=("$syspath[@]") + # remove bad paths... after having combined the arrays to remove duplicates for (( i = 1; i <= $#path; i++ )) { if [[ ! -d $path[$i] ]] { path[$i]=()