From 2adbdf34d98f1181243b8c1b6392d193c5878ec3 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sat, 2 Apr 2016 17:49:13 +0100 Subject: 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 --- middleware/file/tree/elem.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'middleware/file/tree/elem.go') diff --git a/middleware/file/tree/elem.go b/middleware/file/tree/elem.go index 4008e8380..8698a9317 100644 --- a/middleware/file/tree/elem.go +++ b/middleware/file/tree/elem.go @@ -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 { -- cgit v1.2.3