chore: Refactor _get_fastest function to improve readability and performance

This commit is contained in:
Ing 2024-08-14 23:15:02 +08:00
parent 7af514e5e7
commit adb91c29e8

View File

@ -222,7 +222,7 @@ function _get_fastest() {
URL="$(echo "${fastest}" | awk '{print $1}')"
SPD="$(echo "${fastest}" | awk '{print $2}')" # It is a float type
echo "${URL}"
[ $(printf "%.0f" ${SPD:-999}) -ge 999 ] && return 1 || return 0
[ $(echo ${SPD:-999} | cut -d. -f1) -ge 999 ] && return 1 || return 0
}
###############################################################################