From: Mukund Sivaraman Date: Wed, 18 Sep 2013 10:22:55 +0000 (+0530) Subject: [2750] Reduce the number of find() wrappers X-Git-Tag: bind10-1.2.0beta1-release~193^2~4^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0aaef8644a889594af32cd5a3898a63a225b7cb;p=thirdparty%2Fkea.git [2750] Reduce the number of find() wrappers --- diff --git a/src/lib/datasrc/memory/domaintree.h b/src/lib/datasrc/memory/domaintree.h index 727f54a06b..51127cb2b3 100644 --- a/src/lib/datasrc/memory/domaintree.h +++ b/src/lib/datasrc/memory/domaintree.h @@ -1338,17 +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); - - /// \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); - /// \brief Static helper function used by const and non-const /// variants of find() below template @@ -1452,15 +1441,17 @@ public: /// Acts as described in the \ref find section. Result find(const isc::dns::Name& name, DomainTreeNode** node) { - return (findImpl, DomainTreeNode > - (this, name, node)); + DomainTreeNodeChain node_path; + return (findImpl, DomainTreeNode, void* > + (this, name, node, node_path, NULL, NULL)); } /// \brief Simple find (const variant) Result find(const isc::dns::Name& name, const DomainTreeNode** node) const { - return (findImpl, const DomainTreeNode > - (this, name, node)); + DomainTreeNodeChain node_path; + return (findImpl, const DomainTreeNode, void* > + (this, name, node, node_path, NULL, NULL)); } /// \brief Simple find, with node_path tracking @@ -1469,16 +1460,16 @@ public: Result find(const isc::dns::Name& name, DomainTreeNode** node, DomainTreeNodeChain& node_path) { - return (findImpl, DomainTreeNode > - (this, name, node, node_path)); + return (findImpl, DomainTreeNode, void* > + (this, name, 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 > - (this, name, node, node_path)); + return (findImpl, const DomainTreeNode, void* > + (this, name, node, node_path, NULL, NULL)); } /// \brief Simple find with callback @@ -1838,25 +1829,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; - return (tree->find(name, node, node_path, NULL, NULL)); -} - -template -template -typename DomainTree::Result -DomainTree::findImpl(TT* tree, const isc::dns::Name& name, - TTN** node, DomainTreeNodeChain& node_path) -{ - const isc::dns::LabelSequence ls(name); - return (tree->find(ls, node, node_path, NULL, NULL)); -} - template template typename DomainTree::Result