some memory optimisations

This commit is contained in:
Miek Gieben 2015-08-31 16:50:42 +01:00
parent fb82119b66
commit 957df53567
1 changed files with 1 additions and 2 deletions

View File

@ -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 {