Use qname/qtype for lookups

Drop the use of dns.RR when in fact the only thing we use is the name

and type of the RR. Cleans up a bunch of stuff and also stops the weird

making of dns.RRs just for a lookup. Should safe some memory as well.



Fixes: #66
This commit is contained in:
Miek Gieben
2016-04-02 17:49:13 +01:00
parent 9b21646954
commit 2adbdf34d9
5 changed files with 58 additions and 92 deletions

View File

@@ -91,9 +91,8 @@ func (e *Elem) Delete(rr dns.RR) (empty bool) {
return
}
func Less(a *Elem, rr dns.RR) int {
return middleware.Less(rr.Header().Name, a.Name())
}
// Less is a tree helper function that calles middleware.Less.
func Less(a *Elem, name string) int { return middleware.Less(name, a.Name()) }
// Assuming the same type and name this will check if the rdata is equal as well.
func equalRdata(a, b dns.RR) bool {