Skip to content

Commit

Permalink
chore: sort proxies and providers by name before include all
Browse files Browse the repository at this point in the history
  • Loading branch information
wwqgtxx committed Jul 26, 2024
1 parent 40c9829 commit 0d90a93
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
T "github.com/metacubex/mihomo/tunnel"

orderedmap "github.com/wk8/go-ordered-map/v2"
"golang.org/x/exp/slices"
"gopkg.in/yaml.v3"
)

Expand Down Expand Up @@ -792,6 +793,9 @@ func parseProxies(cfg *RawConfig) (proxies map[string]C.Proxy, providersMap map[
AllProviders = append(AllProviders, name)
}

slices.Sort(AllProxies)
slices.Sort(AllProviders)

// parse proxy group
for idx, mapping := range groupsConfig {
group, err := outboundgroup.ParseProxyGroup(mapping, proxies, providersMap, AllProxies, AllProviders)
Expand Down

0 comments on commit 0d90a93

Please sign in to comment.