BIND 10 #447: MemoryZone::find()
BIND 10 Development
do-not-reply at isc.org
Fri Dec 24 09:12:45 UTC 2010
#447: MemoryZone::find()
------------------------------+---------------------------------------------
Reporter: vorner | Owner: vorner
Type: task | Status: reviewing
Priority: major | Milestone:
Component: data source | Resolution:
Keywords: | Sensitive: 0
Estimatedhours: 0.0 | Hours: 0
Billable: 1 | Totalhours: 0
Internal: 0 |
------------------------------+---------------------------------------------
Changes (by hanfeng):
* owner: hanfeng => vorner
Comment:
- Since each node in RBTree store the relative name, so the function
{{{
getRelativeName()
}}}
is redundant.
- For function
{{{
FindResult find(const Name& full_name, RRType type) const
}}}
,it is supposed to modify nothing. so this part code
{{{
if(node->getData()->empty()) {
node->setData(DomainPtr());
}
}}}
will make the code hard to understand and debug.
- Currently, for each RBNode, it has two state, empty or non-empty which
can be get through
{{{
node->isEmpty()
}}}
,But with Domain as node data, you have the
{{{
if(node->getData()->empty())
}}}
check, which also means RBNode is empty, this make the RBNode state not
clear. Now we don't have delete for RBTree and MemoryZone, and the
implementation of MemoryZone should guarantee that if DOMAIN is empty,
the data of the node should empty instead with empty map left.
trivial coding style
- The exception for each module is declared at the begining which make
the code reading much easier, but Memory Zone violate it.
- For function like getRelativeName, if we really need it, since it's a
tool function, it's better to be extracted from class definition or
declare as static function.
--
Ticket URL: <http://bind10.isc.org/ticket/447#comment:7>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list