From 2c78a1456c01470a7e9905e12d6653074a589846 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 20 Feb 2023 16:49:59 -0500 Subject: [PATCH] Switch to mapfile for a minor completions speed improvement Former-commit-id: b1c6d34c450dc0adb6df20fa25a7fa53c6c39ccb [formerly 197542488629970c54e0535ae5698b51281d88a2] Former-commit-id: 9add0ef201cc8f3c934af91c51aad94057d2e9e3 --- extra/sshyp-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/sshyp-completion.bash b/extra/sshyp-completion.bash index a45e7b3..abea8a2 100755 --- a/extra/sshyp-completion.bash +++ b/extra/sshyp-completion.bash @@ -3,7 +3,7 @@ _path_gen() { local sshyp_path="$HOME/.local/share/sshyp" local sshyp_path_length="$(("${#sshyp_path}" + 1))" - readarray -t full_paths < <(find "$sshyp_path" -type f -exec ls {} \;) + mapfile -t full_paths < <(find "$sshyp_path" -type f -exec ls {} \;) for path in "${full_paths[@]}"; do trimmed_path=$(echo ${path%????} | cut -c"$sshyp_path_length"-) trimmed_path=$(echo ${trimmed_path// /\\ })