some memory optimisations
This commit is contained in:
parent
fb82119b66
commit
957df53567
|
@ -8,8 +8,7 @@ func Dedup(rrs []RR, m map[string]RR) []RR {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
m = make(map[string]RR)
|
m = make(map[string]RR)
|
||||||
}
|
}
|
||||||
// We need a (ordered) slice of keys to preserve the original ordering.
|
// Save the keys, so we don't have to call normalizedString twice.
|
||||||
// Otherwise we could just range of the map directly.
|
|
||||||
keys := make([]*string, 0, len(rrs))
|
keys := make([]*string, 0, len(rrs))
|
||||||
|
|
||||||
for _, r := range rrs {
|
for _, r := range rrs {
|
||||||
|
|
Loading…
Reference in New Issue