chore: clean code

This commit is contained in:
metacubex 2022-12-10 11:36:49 +08:00
parent e06c901bf5
commit 05e4237e71
2 changed files with 0 additions and 38 deletions

View File

@ -1,5 +1,3 @@
//go:build !premium
package config package config
import ( import (

View File

@ -1,36 +0,0 @@
//go:build premium
package config
import (
"io"
"github.com/Dreamacro/clash/config"
)
func forEachProviders(rawCfg *config.RawConfig, fun func(index int, total int, key string, provider map[string]any)) {
total := len(rawCfg.ProxyProvider) + len(rawCfg.RuleProvider)
index := 0
for k, v := range rawCfg.ProxyProvider {
fun(index, total, k, v)
index++
}
for k, v := range rawCfg.RuleProvider {
fun(index, total, k, v)
index++
}
}
func destroyProviders(cfg *config.Config) {
for _, p := range cfg.ProxyProviders {
_ = p.(io.Closer).Close()
}
for _, p := range cfg.RuleProviders {
_ = p.(io.Closer).Close()
}
}