Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions vpn-auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,17 @@ if [ -n "$US_SERVERS" ]; then
state="${server#US-}"
state="${state%%#*}"

# ⚡ Bolt: Replaced regex evaluation (=~) with native bash glob matching.
# Impact: Avoids regex compilation overhead in a tight loop, speeding up server filtering.
# Check against exclusions
if [[ "$state" =~ ^($EXCLUDED_STATES)$ ]]; then
if [[ "|$EXCLUDED_STATES|" == *"|$state|"* ]]; then
continue
fi

FILTERED_SERVERS+=("$server")

# Check against favorites
if [[ "$state" =~ ^($FAVORED_STATES)$ ]]; then
if [[ "|$FAVORED_STATES|" == *"|$state|"* ]]; then
FAVORED_SERVERS+=("$server")
fi
done
Expand Down