diff --git a/experimental/clashapi/proxies.go b/experimental/clashapi/proxies.go index be0f22a1..8e3e19f4 100644 --- a/experimental/clashapi/proxies.go +++ b/experimental/clashapi/proxies.go @@ -134,7 +134,7 @@ func getProxies(server *Server, router adapter.Router) func(w http.ResponseWrite defaultTag = allProxies[0] } - sort.Slice(allProxies, func(i, j int) bool { + sort.SliceStable(allProxies, func(i, j int) bool { return allProxies[i] == defaultTag }) diff --git a/outbound/urltest.go b/outbound/urltest.go index 580ab426..9717a86c 100644 --- a/outbound/urltest.go +++ b/outbound/urltest.go @@ -233,7 +233,7 @@ func (g *URLTestGroup) Fallback(used adapter.Outbound) []adapter.Outbound { outbounds = append(outbounds, detour) } } - sort.Slice(outbounds, func(i, j int) bool { + sort.SliceStable(outbounds, func(i, j int) bool { oi := outbounds[i] oj := outbounds[j] hi := g.history.LoadURLTestHistory(RealTag(oi))