mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
remove unused functions
This commit is contained in:
parent
769f770cf7
commit
234c8081f4
@ -11,6 +11,7 @@ func (n Network) SystemString() string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HasNetwork returns true if the network list has a certain network.
|
||||||
func HasNetwork(list []Network, network Network) bool {
|
func HasNetwork(list []Network, network Network) bool {
|
||||||
for _, value := range list {
|
for _, value := range list {
|
||||||
if value == network {
|
if value == network {
|
||||||
@ -19,18 +20,3 @@ func HasNetwork(list []Network, network Network) bool {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasNetwork returns true if the given network is in v NetworkList.
|
|
||||||
func (l NetworkList) HasNetwork(network Network) bool {
|
|
||||||
for _, value := range l.Network {
|
|
||||||
if string(value) == string(network) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Size returns the number of networks in this network list.
|
|
||||||
func (l NetworkList) Size() int {
|
|
||||||
return len(l.Network)
|
|
||||||
}
|
|
||||||
|
@ -38,7 +38,7 @@ type DokodemoDoor struct {
|
|||||||
|
|
||||||
// Init initializes the DokodemoDoor instance with necessary parameters.
|
// Init initializes the DokodemoDoor instance with necessary parameters.
|
||||||
func (d *DokodemoDoor) Init(config *Config, pm policy.Manager) error {
|
func (d *DokodemoDoor) Init(config *Config, pm policy.Manager) error {
|
||||||
if (config.NetworkList == nil || config.NetworkList.Size() == 0) && len(config.Networks) == 0 {
|
if (config.NetworkList == nil || len(config.NetworkList.Network) == 0) && len(config.Networks) == 0 {
|
||||||
return newError("no network specified")
|
return newError("no network specified")
|
||||||
}
|
}
|
||||||
d.config = config
|
d.config = config
|
||||||
|
Loading…
Reference in New Issue
Block a user