From: JINMEI Tatuya Date: Fri, 20 Jul 2012 21:06:38 +0000 (-0700) Subject: [2091a] removed a redundant condition. X-Git-Tag: trac2351_base~157^2~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f554bfb2cfc6b108e253214aae99fbdd7f75593c;p=thirdparty%2Fkea.git [2091a] removed a redundant condition. if nlabels == 0, it must not be absolute because otherwise the other should also be absolute, in which case nlabes != 0. --- diff --git a/src/lib/dns/labelsequence.cc b/src/lib/dns/labelsequence.cc index a778c8e96d..c2e82dd691 100644 --- a/src/lib/dns/labelsequence.cc +++ b/src/lib/dns/labelsequence.cc @@ -157,13 +157,10 @@ LabelSequence::compare(const LabelSequence& other, } if (chdiff != 0) { - if (nlabels == 0 && !isAbsolute()) { - return (NameComparisonResult(chdiff, 0, - NameComparisonResult::NONE)); - } else { - return (NameComparisonResult(chdiff, nlabels, - NameComparisonResult::COMMONANCESTOR)); - } + return (NameComparisonResult( + chdiff, nlabels, + nlabels == 0 ? NameComparisonResult::NONE : + NameComparisonResult::COMMONANCESTOR)); } --count; ++pos1;