Browse Source

[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.
JINMEI Tatuya 12 years ago
parent
commit
f554bfb2cf
1 changed files with 4 additions and 7 deletions
  1. 4 7
      src/lib/dns/labelsequence.cc

+ 4 - 7
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;