BIND 10 #2091: use encoded name data in RBNode

BIND 10 Development do-not-reply at isc.org
Sat Jul 28 10:03:37 UTC 2012


#2091: use encoded name data in RBNode
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  jinmei
  jinmei                             |                Status:  reviewing
                       Type:  task   |             Milestone:
                   Priority:         |  Sprint-20120731
  medium                             |            Resolution:
                  Component:  data   |             Sensitive:  0
  source                             |           Sub-Project:  DNS
                   Keywords:         |  Estimated Difficulty:  5
            Defect Severity:  N/A    |           Total Hours:  0
Feature Depending on Ticket:         |
  scalable inmemory                  |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Changes (by vorner):

 * owner:  vorner => jinmei


Comment:

 Hello

 Replying to [comment:16 jinmei]:
 > >  * In this piece of code, the getName needlessly asserts a
 prerequisite it doesn't have to care about. Also, the same assert is
 called twice:
 > > {{{#!c++
 > >     const isc::dns::Name getName() const {
 > >         assert(labels_capacity_ != 0); // shouldn't be called on a
 NULL node.
 > >         return
 (dns::Name(dns::LabelSequence(getLabelsData()).toText()));
 > >     }
 > >
 > >     /// \brief Return the label sequence of the node.
 > >     ///
 > >     /// This method returns the label sequence corresponding to this
 node
 > >     /// in the form of \c dns::LabelSequence object.  Any modification
 to
 > >     /// the tree can invalidate the returned \c LabelSequence object
 or copy
 > >     /// of it; in general, it's expected to be used in a very limited
 scope.
 > >     dns::LabelSequence getLabels() const {
 > >         assert(labels_capacity_ != 0); // shouldn't be called on a
 NULL node.
 > >         return (dns::LabelSequence(getLabelsData()));
 > >     }
 > > }}}
 >
 > You mean by "needlessly" this shouldn't never be called on a NULL
 > node, or do you mean we *won't* have to worry about it because we're
 > deprecating the NULL node (in the form of node object)?  If it's the
 > former, it was not so obvious to me; if it's the latter, I'm okay with
 > making the change at this point.

 Um, I read the code badly. I thought it calls getLabels, which is just
 below and contains the same assert. I was wrong there. Maybe the assert
 should be in getLabelsData()? But, as you say, we're deprecating NULL
 nodes anyway, so it probably doesn't matter.

 So I think it can be merged.

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


More information about the bind10-tickets mailing list