]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1805] minor optimization: check nsec_signed first in getClosestNSEC().
authorJINMEI Tatuya <jinmei@isc.org>
Wed, 9 May 2012 20:54:03 +0000 (13:54 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Wed, 9 May 2012 20:54:03 +0000 (13:54 -0700)
in practice the DNSSEC option is provided in many cases, considering
the common default behavior of widely deployed resolvers, while not many
zones are actually not signed at all in the first place (much less whether
it's NSEC or NSEC3).  so in many cases we should simply be able to stop the
condition check with the nsec_signed.

src/lib/datasrc/memory_datasrc.cc

index 1e5b4ecf9ebf96dfffc43100185b10be0730dfd7..1d026caf717ab0aabbfc507b54c5e0abca8b555e 100644 (file)
@@ -251,7 +251,7 @@ ConstRBNodeRRsetPtr
 ZoneData::getClosestNSEC(RBTreeNodeChain<Domain>& node_path,
                          ZoneFinder::FindOptions options) const
 {
-    if ((options & ZoneFinder::FIND_DNSSEC) == 0 || !nsec_signed_) {
+    if (!nsec_signed_ || (options & ZoneFinder::FIND_DNSSEC) == 0) {
         return (ConstRBNodeRRsetPtr());
     }