zsh: Remove path deduplication

Aside from some more needed things, the path deduplication function is
the most time-consuming invocation on zsh startup, taking almost
100ms on my system.

Perhaps it would be reasonable to re-introduce when the first invocation
from path is occurring but it is simply too much time taken for each
time I start a new shell instance for now.
This commit is contained in:
Marty Oehme 2023-12-04 08:32:49 +01:00
parent 3bd67eab3d
commit eeca1f3817
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -192,14 +192,6 @@ get_var() {
set_var() { set_var() {
eval "$1=\"\$2\"" eval "$1=\"\$2\""
} }
dedup_pathvar() {
pathvar_name="$1"
pathvar_value="$(get_var "$pathvar_name")"
deduped_path="$(perl -e 'print join(":",grep { not $seen{$_}++ } split(/:/, $ARGV[0]))' "$pathvar_value")"
set_var "$pathvar_name" "$deduped_path"
}
dedup_pathvar PATH
dedup_pathvar MANPATH
unset CONFDIR unset CONFDIR
unset ZSHCONFDIR unset ZSHCONFDIR