From: JINMEI Tatuya Date: Wed, 27 Jun 2012 21:29:51 +0000 (-0700) Subject: [1771-2] cleanup: minimized the scope of some local variables. X-Git-Tag: trac2351_base~213^2^2~1^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d1e088cf6ecc8d99c293d195a05433d9d3742ba4;p=thirdparty%2Fkea.git [1771-2] cleanup: minimized the scope of some local variables. --- diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc index 03bd839b27..85c21bd6e6 100644 --- a/src/lib/datasrc/database.cc +++ b/src/lib/datasrc/database.cc @@ -444,11 +444,6 @@ DatabaseClient::Finder::findDelegationPoint(const isc::dns::Name& name, for (int i = remove_labels; i > 0; --i) { const Name superdomain(name.split(i)); - // Note if this is the origin. (We don't count NS records at the origin - // as a delegation so this controls whether NS RRs are included in - // the results of some searches.) - const bool not_origin = (i != remove_labels); - // Look if there's NS or DNAME at this point of the tree, but ignore // the NS RRs at the apex of the zone. const FoundRRsets found = getRRsets(superdomain.toText(), @@ -458,6 +453,11 @@ DatabaseClient::Finder::findDelegationPoint(const isc::dns::Name& name, const FoundIterator nsi(found.second.find(RRType::NS())); const FoundIterator dni(found.second.find(RRType::DNAME())); + // Note if this is the origin. (We don't count NS records at the + // origin as a delegation so this controls whether NS RRs are + // included in the results of some searches.) + const bool not_origin = (i != remove_labels); + // An optimisation. We know that there is an exact match for // something at this point in the tree so remember it. If we have // to do a wildcard search, as we search upwards through the tree @@ -972,7 +972,6 @@ DatabaseClient::Finder::findInternal(const Name& name, const RRType& type, // - Requested name is a delegation point (NS only but not at the zone // apex - DNAME is ignored here as it redirects DNS names subordinate to // the owner name - the owner name itself is not redirected.) - const bool is_origin = (name == getOrigin()); WantedTypes final_types(FINAL_TYPES()); final_types.insert(type); const FoundRRsets found = getRRsets(name.toText(), final_types, @@ -981,6 +980,7 @@ DatabaseClient::Finder::findInternal(const Name& name, const RRType& type, if (found.first) { // Something found at the domain name. Look into it further to get // the final result. + const bool is_origin = (name == getOrigin()); return (findOnNameResult(name, type, options, is_origin, found, NULL, target, dnssec_ctx)); } else {