Browse Source

[1805] minor optimization: check nsec_signed first in getClosestNSEC().

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.
JINMEI Tatuya 13 years ago
parent
commit
32bb3f9e17
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/lib/datasrc/memory_datasrc.cc

+ 1 - 1
src/lib/datasrc/memory_datasrc.cc

@@ -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());
     }