[eos-bash-shared] small performance improvement

This commit is contained in:
manuel
2025-10-12 11:44:24 +03:00
parent f1894c71c0
commit 0135e229f1
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ yad_ChangeDisplayResolution() {
local b_refresh=10 # button "Set and stay" clicked
local b_exit=252 # (X) clicked in the upper right corner
readarray -t resosarr <<< $(echo "$resos")
readarray -t resosarr < <(echo "$resos")
if [ -n "$reso" ] ; then
if [ -n "$(echo "$resos" | grep "$reso")" ] ; then
+2 -2
View File
@@ -64,10 +64,10 @@ CheckYourArchMirrorlist() {
# get working mirrors from the Arch mirrorlist page
all_working_mirrors=$(curl --fail -Lsm 30 "$url") || DIE "failed to fetch available mirrors (curl code $?)"
[ "$all_working_mirrors" ] || DIE "-> archlinux.org/mirrorlist failed"
readarray -t all_working_mirrors <<< $(echo "$all_working_mirrors" | tail -n +7 | grep "^#Server = " | awk '{print $NF}')
readarray -t all_working_mirrors < <(echo "$all_working_mirrors" | tail -n +7 | grep "^#Server = " | awk '{print $NF}')
# get mirrors from local mirrorlist
readarray -t local_mirrors <<< $(grep -n "^[ \t]*Server[ \t]*=[ \t]*" $aml | sed 's|[ \t]*Server[ \t]*=[ \t]*||')
readarray -t local_mirrors < <(grep -n "^[ \t]*Server[ \t]*=[ \t]*" $aml | sed 's|[ \t]*Server[ \t]*=[ \t]*||')
for lm in "${local_mirrors[@]}" ; do
if printf "%s\n" "${all_working_mirrors[@]}" | grep "${lm#*:}" >/dev/null ; then
+1 -1
View File
@@ -114,7 +114,7 @@ Main() {
CheckValueYesNo "$separator" "--separator"
if [ ${#pkgnames} -eq 0 ] ; then
readarray -t pkgnames <<< $(AsPlainUserIfElevated $helper -Quq) # assumes 'pacman -Sy' was just executed
readarray -t pkgnames < <(AsPlainUserIfElevated $helper -Quq) # assumes 'pacman -Sy' was just executed
[ ${#pkgnames} -eq 0 ] && return
fi