mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-05 17:13:32 +08:00
[Fixed]Meaningless pointer
This commit is contained in:
parent
a78b89d16e
commit
58ef4ddbba
@ -493,7 +493,7 @@ func parseRules(cfg *RawConfig, proxies map[string]C.Proxy) ([]C.Rule, map[strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
ruleProviders[name] = &rp
|
ruleProviders[name] = &rp
|
||||||
R.SetRuleProvider(&rp)
|
R.SetRuleProvider(rp)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, provider := range ruleProviders {
|
for _, provider := range ruleProviders {
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ruleProviders = map[string]*P.RuleProvider{}
|
ruleProviders = map[string]P.RuleProvider{}
|
||||||
)
|
)
|
||||||
|
|
||||||
type ruleSetProvider struct {
|
type ruleSetProvider struct {
|
||||||
@ -38,13 +38,13 @@ type RulePayload struct {
|
|||||||
Rules []string `yaml:"payload"`
|
Rules []string `yaml:"payload"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func RuleProviders() map[string]*P.RuleProvider {
|
func RuleProviders() map[string]P.RuleProvider {
|
||||||
return ruleProviders
|
return ruleProviders
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetRuleProvider(ruleProvider *P.RuleProvider) {
|
func SetRuleProvider(ruleProvider P.RuleProvider) {
|
||||||
if ruleProvider != nil {
|
if ruleProvider != nil {
|
||||||
ruleProviders[(*ruleProvider).Name()] = ruleProvider
|
ruleProviders[(ruleProvider).Name()] = ruleProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
type RuleSet struct {
|
type RuleSet struct {
|
||||||
ruleProviderName string
|
ruleProviderName string
|
||||||
adapter string
|
adapter string
|
||||||
ruleProvider *P.RuleProvider
|
ruleProvider P.RuleProvider
|
||||||
ruleExtra *C.RuleExtra
|
ruleExtra *C.RuleExtra
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ func (rs *RuleSet) getProviders() P.RuleProvider {
|
|||||||
rs.ruleProvider = rp
|
rs.ruleProvider = rp
|
||||||
}
|
}
|
||||||
|
|
||||||
return *rs.ruleProvider
|
return rs.ruleProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rs *RuleSet) RuleExtra() *C.RuleExtra {
|
func (rs *RuleSet) RuleExtra() *C.RuleExtra {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user