From: Mukund Sivaraman Date: Wed, 18 Sep 2013 11:47:02 +0000 (+0530) Subject: [2750] Reduce another layer of find() wrapper X-Git-Tag: bind10-1.2.0beta1-release~193^2~4^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=08bc7db55cafdd916ae227ff7ca524542de280f4;p=thirdparty%2Fkea.git [2750] Reduce another layer of find() wrapper --- diff --git a/src/lib/datasrc/memory/domaintree.h b/src/lib/datasrc/memory/domaintree.h index 51127cb2b3..05d97950b1 100644 --- a/src/lib/datasrc/memory/domaintree.h +++ b/src/lib/datasrc/memory/domaintree.h @@ -1338,14 +1338,6 @@ private: bool (*callback)(const DomainTreeNode&, CBARG), CBARG callback_arg); - /// \brief Static helper function used by const and non-const - /// variants of find() below - template - static Result findImpl(TT* tree, const isc::dns::Name& name, - TTN** node, DomainTreeNodeChain& node_path, - bool (*callback)(const DomainTreeNode&, CBARG), - CBARG callback_arg); - public: /// \brief Find with callback and node chain /// \anchor callback @@ -1441,17 +1433,17 @@ public: /// Acts as described in the \ref find section. Result find(const isc::dns::Name& name, DomainTreeNode** node) { + const isc::dns::LabelSequence ls(name); DomainTreeNodeChain node_path; - return (findImpl, DomainTreeNode, void* > - (this, name, node, node_path, NULL, NULL)); + return (find(ls, node, node_path, NULL, NULL)); } /// \brief Simple find (const variant) Result find(const isc::dns::Name& name, const DomainTreeNode** node) const { + const isc::dns::LabelSequence ls(name); DomainTreeNodeChain node_path; - return (findImpl, const DomainTreeNode, void* > - (this, name, node, node_path, NULL, NULL)); + return (find(ls, node, node_path, NULL, NULL)); } /// \brief Simple find, with node_path tracking @@ -1460,16 +1452,16 @@ public: Result find(const isc::dns::Name& name, DomainTreeNode** node, DomainTreeNodeChain& node_path) { - return (findImpl, DomainTreeNode, void* > - (this, name, node, node_path, NULL, NULL)); + const isc::dns::LabelSequence ls(name); + return (find(ls, node, node_path, NULL, NULL)); } /// \brief Simple find, with node_path tracking (const variant) Result find(const isc::dns::Name& name, const DomainTreeNode** node, DomainTreeNodeChain& node_path) const { - return (findImpl, const DomainTreeNode, void* > - (this, name, node, node_path, NULL, NULL)); + const isc::dns::LabelSequence ls(name); + return (find(ls, node, node_path, NULL, NULL)); } /// \brief Simple find with callback @@ -1480,8 +1472,8 @@ public: bool (*callback)(const DomainTreeNode&, CBARG), CBARG callback_arg) { - return (findImpl, DomainTreeNode > - (this, name, node, node_path, callback, callback_arg)); + const isc::dns::LabelSequence ls(name); + return (find(ls, node, node_path, callback, callback_arg)); } /// \brief Simple find with callback (const variant) @@ -1492,8 +1484,8 @@ public: bool (*callback)(const DomainTreeNode&, CBARG), CBARG callback_arg) const { - return (findImpl, const DomainTreeNode > - (this, name, node, node_path, callback, callback_arg)); + const isc::dns::LabelSequence ls(name); + return (find(ls, node, node_path, callback, callback_arg)); } //@} @@ -1829,18 +1821,6 @@ DomainTree::deleteHelper(util::MemorySegment& mem_sgmt, } } -template -template -typename DomainTree::Result -DomainTree::findImpl(TT* tree, const isc::dns::Name& name, - TTN** node, DomainTreeNodeChain& node_path, - bool (*callback)(const DomainTreeNode&, CBARG), - CBARG callback_arg) -{ - const isc::dns::LabelSequence ls(name); - return (tree->find(ls, node, node_path, callback, callback_arg)); -} - template template typename DomainTree::Result