1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-25 00:45:24 +00:00

change from map to slice

This commit is contained in:
Darien Raymond 2018-11-20 17:15:11 +01:00
parent 234c8081f4
commit bb8cab9cc7
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -9,7 +9,7 @@ import (
// StaticHosts represents static domain-ip mapping in DNS server.
type StaticHosts struct {
ips map[uint32][]net.IP
ips [][]net.IP
matchers *strmatcher.MatcherGroup
}
@ -36,7 +36,7 @@ func toStrMatcher(t DomainMatchingType, domain string) (strmatcher.Matcher, erro
func NewStaticHosts(hosts []*Config_HostMapping, legacy map[string]*net.IPOrDomain) (*StaticHosts, error) {
g := new(strmatcher.MatcherGroup)
sh := &StaticHosts{
ips: make(map[uint32][]net.IP),
ips: make([][]net.IP, len(hosts)+len(legacy)+16),
matchers: g,
}