From 957df535677fe2161a0948b08d625f8e9fa6395b Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Mon, 31 Aug 2015 16:50:42 +0100 Subject: [PATCH] some memory optimisations --- sanitize.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sanitize.go b/sanitize.go index 4df061f5..b489f3f0 100644 --- a/sanitize.go +++ b/sanitize.go @@ -8,8 +8,7 @@ func Dedup(rrs []RR, m map[string]RR) []RR { if m == nil { m = make(map[string]RR) } - // We need a (ordered) slice of keys to preserve the original ordering. - // Otherwise we could just range of the map directly. + // Save the keys, so we don't have to call normalizedString twice. keys := make([]*string, 0, len(rrs)) for _, r := range rrs {