diff options
author | 2016-04-02 17:49:13 +0100 | |
---|---|---|
committer | 2016-04-02 17:49:13 +0100 | |
commit | 2adbdf34d98f1181243b8c1b6392d193c5878ec3 (patch) | |
tree | 7cc638a43b3569ac7871c05e644223e2a850df69 /middleware/file/tree/elem.go | |
parent | 9b21646954c8fea174be8b769f16ddb213286753 (diff) | |
download | coredns-2adbdf34d98f1181243b8c1b6392d193c5878ec3.tar.gz coredns-2adbdf34d98f1181243b8c1b6392d193c5878ec3.tar.zst coredns-2adbdf34d98f1181243b8c1b6392d193c5878ec3.zip |
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
Diffstat (limited to 'middleware/file/tree/elem.go')
-rw-r--r-- | middleware/file/tree/elem.go | 5 |
1 files changed, 2 insertions, 3 deletions
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 { |