From: Mukund Sivaraman Date: Wed, 4 Jul 2012 03:54:48 +0000 (+0530) Subject: [2053] Remove loop to locate the start point X-Git-Tag: trac2351_base~206 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=15364a524a668d37a4fd63427f4eda5fd79e60e6;p=thirdparty%2Fkea.git [2053] Remove loop to locate the start point --- diff --git a/src/lib/dns/labelsequence.cc b/src/lib/dns/labelsequence.cc index c1db000497..6f07830cbb 100644 --- a/src/lib/dns/labelsequence.cc +++ b/src/lib/dns/labelsequence.cc @@ -128,7 +128,8 @@ LabelSequence::toText(bool omit_final_dot) const { return ("."); } - Name::NameString::const_iterator np = name_.ndata_.begin(); + Name::NameString::const_iterator np = name_.ndata_.begin() + + name_.offsets_[first_label_]; const Name::NameString::const_iterator np_end = name_.ndata_.end(); // use for integrity check unsigned int labels = last_label_ - first_label_; @@ -140,11 +141,6 @@ LabelSequence::toText(bool omit_final_dot) const { std::string result; result.reserve(name_.length_); - for (unsigned int i = 0; i < first_label_; i++) { - count = *np++; - np += count; - } - while (np != np_end) { labels--; count = *np++;