From 8dea62cd63d826223e426ac0f8250ce918594c7b Mon Sep 17 00:00:00 2001 From: adlyq <2833154405@qq.com> Date: Thu, 28 Apr 2022 23:49:24 +0800 Subject: [PATCH] refactor: del useless file --- adapter/outboundgroup/common.go | 52 --------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 adapter/outboundgroup/common.go diff --git a/adapter/outboundgroup/common.go b/adapter/outboundgroup/common.go deleted file mode 100644 index c2623ed3..00000000 --- a/adapter/outboundgroup/common.go +++ /dev/null @@ -1,52 +0,0 @@ -package outboundgroup - -import ( - "github.com/Dreamacro/clash/tunnel" - "github.com/dlclark/regexp2" - "time" - - C "github.com/Dreamacro/clash/constant" - "github.com/Dreamacro/clash/constant/provider" -) - -const ( - defaultGetProxiesDuration = time.Second * 5 -) - -func getProvidersProxies(providers []provider.ProxyProvider, touch bool, filter string) []C.Proxy { - proxies := []C.Proxy{} - for _, provider := range providers { - if touch { - proxies = append(proxies, provider.ProxiesWithTouch()...) - } else { - proxies = append(proxies, provider.Proxies()...) - } - } - - var filterReg *regexp2.Regexp = nil - var matchedProxies []C.Proxy - if len(filter) > 0 { - //filterReg = regexp.MustCompile(filter) - filterReg = regexp2.MustCompile(filter, 0) - for _, p := range proxies { - - //if filterReg.MatchString(p.Name()) { - if mat, _ := filterReg.FindStringMatch(p.Name()); mat != nil { - matchedProxies = append(matchedProxies, p) - } - } - - if len(matchedProxies) > 0 { - return matchedProxies - } else { - return append([]C.Proxy{}, tunnel.Proxies()["COMPATIBLE"]) - } - } else { - if len(proxies) == 0 { - return append(proxies, tunnel.Proxies()["COMPATIBLE"]) - } else { - return proxies - } - } - -}