plugin/file: optimize cname get rr by type (#5080)

Signed-off-by: xuweiwei <xuweiwei_yewu@cmss.chinamobile.com>
This commit is contained in:
xuweiwei 2022-01-22 07:05:11 +08:00 committed by GitHub
parent 1c6b68f3cb
commit 1d3e901157
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 12 deletions

View file

@ -366,7 +366,7 @@ Redo:
goto Redo
}
targets := rrutil.CNAMEForType(elem.All(), qtype)
targets := elem.Type(qtype)
if len(targets) > 0 {
rrs = append(rrs, targets...)

View file

@ -16,14 +16,3 @@ func SubTypeSignature(rrs []dns.RR, subtype uint16) []dns.RR {
}
return sigs
}
// CNAMEForType returns the RR that have the qtype from targets.
func CNAMEForType(rrs []dns.RR, qtype uint16) []dns.RR {
ret := []dns.RR{}
for _, target := range rrs {
if target.Header().Rrtype == qtype {
ret = append(ret, target)
}
}
return ret
}