From bb8cab9cc7cd53de6fc1422d457f0e11386fe11a Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Tue, 20 Nov 2018 17:15:11 +0100 Subject: [PATCH] change from map to slice --- app/dns/hosts.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/dns/hosts.go b/app/dns/hosts.go index 2871c1e7f..9cc550a0b 100644 --- a/app/dns/hosts.go +++ b/app/dns/hosts.go @@ -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, }