BIND 10 #1602: Introduce dns::LabelSequence class

BIND 10 Development do-not-reply at isc.org
Wed Feb 29 15:26:40 UTC 2012


#1602: Introduce dns::LabelSequence class
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  jelte
  jinmei                             |                Status:  reviewing
                       Type:  task   |             Milestone:
                   Priority:  major  |  Sprint-20120306
                  Component:         |            Resolution:
  libdns++                           |             Sensitive:  0
                   Keywords:         |           Sub-Project:  DNS
            Defect Severity:  N/A    |  Estimated Difficulty:  7
Feature Depending on Ticket:  auth   |           Total Hours:  0
  performance                        |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Changes (by vorner):

 * owner:  vorner => jelte


Comment:

 Hello

 Your clock seem to be off by quite a lot, did you run ntp recently? ;-)
 {{{#!c++
 // Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")
 }}}

 This could go to the initalizers of the constructor as well:
 {{{#!c++
 last_label_ = name.getLabelCount();
 }}}

 Is the second if really needed here? If `i` is zero, it won't change
 anything anyway
 {{{#!c++
     if (i > 0) {
         first_label_ += i;
     } else if (i < 0) {
         last_label_ += i;
     }
 }}}

 However, I don't think it is a good idea here to distinguish the ends by
 positive/negative integers. I think two separate methods would be better
 in this case ‒ I don't see any way this could be more convenient and it is
 possibly more confusing.

 The offsets are created each time it is created. However, as the `Name`
 object must have go through the lengths as well (because it counted the
 labels), wouldn't it be better to put the offsets vector into the name and
 only access that one? (This would also make the class much more
 lightweight, since there'd be one pointer and two `size_t` integers).

 And, the `at_p` (besides having the wrong capitalization) could be made
 private and `LabelSequence` made a friend. It sounds cleaner to me than
 the current „not recommended to any use“ way.

-- 
Ticket URL: <http://bind10.isc.org/ticket/1602#comment:11>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list