summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJelte Jansen <jelte@isc.org>2012-07-09 09:51:08 +0200
committerJelte Jansen <jelte@isc.org>2012-07-09 09:57:12 +0200
commit8eaa01c8bc19861c1ad146f3099e6636cb3d48d4 (patch)
treea449c290d38b85e48004c5f7805993e2324b5d4f /src/lib
parent[2086] use raw Name data in LabelSequence (diff)
downloadkea-8eaa01c8bc19861c1ad146f3099e6636cb3d48d4.tar.xz
kea-8eaa01c8bc19861c1ad146f3099e6636cb3d48d4.zip
[2086] Cleanups
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/dns/labelsequence.cc8
-rw-r--r--src/lib/dns/labelsequence.h2
-rw-r--r--src/lib/dns/name.h31
3 files changed, 3 insertions, 38 deletions
diff --git a/src/lib/dns/labelsequence.cc b/src/lib/dns/labelsequence.cc
index 351d86b45a..6e778f42ae 100644
--- a/src/lib/dns/labelsequence.cc
+++ b/src/lib/dns/labelsequence.cc
@@ -82,11 +82,6 @@ LabelSequence::compare(const LabelSequence& other,
// 'this' and 'other', and also determine the hierarchical relationship
// of the names.
- if ((first_label_ > last_label_) ||
- (other.first_label_ > other.last_label_)) {
- isc_throw(BadValue, "Bad label index ranges were passed");
- }
-
unsigned int nlabels = 0;
int l1 = last_label_ - first_label_;
int l2 = other.last_label_ - other.first_label_;
@@ -117,7 +112,8 @@ LabelSequence::compare(const LabelSequence& other,
if (case_sensitive) {
chdiff = (int)label1 - (int)label2;
} else {
- chdiff = (int)isc::dns::name::internal::maptolower[label1] - (int)isc::dns::name::internal::maptolower[label2];
+ chdiff = (int)isc::dns::name::internal::maptolower[label1] -
+ (int)isc::dns::name::internal::maptolower[label2];
}
if (chdiff != 0) {
diff --git a/src/lib/dns/labelsequence.h b/src/lib/dns/labelsequence.h
index f2b3c112ef..c2149f0ce8 100644
--- a/src/lib/dns/labelsequence.h
+++ b/src/lib/dns/labelsequence.h
@@ -53,7 +53,7 @@ public:
/// to the labels in the Name object).
///
/// \param name The Name to construct a LabelSequence for
- explicit LabelSequence(const Name& name): /*name_(name),*/
+ explicit LabelSequence(const Name& name):
data_(&name.ndata_[0]),
offsets_(&name.offsets_[0]),
offsets_size_(name.offsets_.size()),
diff --git a/src/lib/dns/name.h b/src/lib/dns/name.h
index 92c9c5fd59..27186d7c7a 100644
--- a/src/lib/dns/name.h
+++ b/src/lib/dns/name.h
@@ -405,37 +405,6 @@ public:
/// comparison result.
NameComparisonResult compare(const Name& other) const;
-private:
- /// \brief Partially compare two <code>Name</code>s.
- ///
- /// This method performs a partial comparison of the
- /// <code>Name</code> and <code>other</code> and returns the result
- /// in the form of a <code>NameComparisonResult</code> object.
- ///
- /// This method can throw the BadValue exception if bad label
- /// indices are passed.
- ///
- /// \param other the right-hand operand to compare against.
- /// \param first_label the left-most label of <code>Name</code> to
- /// begin comparing from.
- /// \param first_label_other the left-most label of
- /// <code>other</code> to begin comparing from.
- /// \param last_label the right-most label of <code>Name</code> to
- /// end comparing at.
- /// \param last_label_other the right-most label of
- /// <code>other</code> to end comparing at.
- /// \param case_sensitive If true, comparison is case-insensitive
- /// \return a <code>NameComparisonResult</code> object representing the
- /// comparison result.
-/*
- NameComparisonResult compare(const Name& other,
- unsigned int first_label,
- unsigned int first_label_other,
- unsigned int last_label,
- unsigned int last_label_other,
- bool case_sensitive = false) const;
-*/
-
public:
/// \brief Return true iff two names are equal.
///