]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2091a] removed a redundant condition.
authorJINMEI Tatuya <jinmei@isc.org>
Fri, 20 Jul 2012 21:06:38 +0000 (14:06 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Fri, 20 Jul 2012 21:06:38 +0000 (14:06 -0700)
if nlabels == 0, it must not be absolute because otherwise the other
should also be absolute, in which case nlabes != 0.

src/lib/dns/labelsequence.cc

index a778c8e96d6fc2a814d80dc1e6426e1541f667d2..c2e82dd691367f65920e9a03894e59cc942e92ee 100644 (file)
@@ -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;