Merge pull request #7598 from pierresouchay/preallocation_of_dns_meta

Pre-allocations of DNS meta to avoid several allocations
This commit is contained in:
Daniel Nephin 2020-04-06 14:00:32 -04:00 committed by GitHub
commit 72e2695986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1694,7 +1694,7 @@ func (d *DNSServer) nodeServiceRecords(dc string, node structs.CheckServiceNode,
}
func (d *DNSServer) generateMeta(dc string, qName string, node *structs.Node, ttl time.Duration) []dns.RR {
var extra []dns.RR
extra := make([]dns.RR, 0, len(node.Meta))
for key, value := range node.Meta {
txt := value
if !strings.HasPrefix(strings.ToLower(key), "rfc1035-") {