From: Marcin Siodelski Date: Fri, 4 Jan 2013 09:13:12 +0000 (+0100) Subject: [2315] Minor code cleanup. X-Git-Tag: bind10-1.0.0-rc-release~95^2~25^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ed60b95b8cbdff758e08062fc82c8d8f7b367ac;p=thirdparty%2Fkea.git [2315] Minor code cleanup. --- diff --git a/src/lib/dhcpsrv/cfgmgr.h b/src/lib/dhcpsrv/cfgmgr.h index 48fb027f8a..87e3ad60dd 100644 --- a/src/lib/dhcpsrv/cfgmgr.h +++ b/src/lib/dhcpsrv/cfgmgr.h @@ -217,6 +217,7 @@ protected: private: /// A map containing option definitions for different option spaces. + /// The map key holds an option space name. std::map option_def_spaces_; }; diff --git a/src/lib/dhcpsrv/subnet.cc b/src/lib/dhcpsrv/subnet.cc index 5e6186c30d..70e762e76c 100644 --- a/src/lib/dhcpsrv/subnet.cc +++ b/src/lib/dhcpsrv/subnet.cc @@ -62,12 +62,6 @@ Subnet::delOptions() { option_spaces_.clear(); } -const Subnet::OptionContainer& -Subnet::emptyOptionContainer() { - static OptionContainer container; - return (container); -} - const Subnet::OptionContainer& Subnet::getOptions(const std::string& option_space) const { // Search the map to get the options container for the particular @@ -78,7 +72,9 @@ Subnet::getOptions(const std::string& option_space) const { // has been configured for this option space yet. Thus we have to // return an empty container to the caller. if (options == option_spaces_.end()) { - return (emptyOptionContainer()); + // The default constructor creates an empty container. + static OptionContainer container; + return (container); } // We found some option container for the option space specified. // Let's return a const reference to it. diff --git a/src/lib/dhcpsrv/subnet.h b/src/lib/dhcpsrv/subnet.h index c2cdfb8519..2941c0172b 100644 --- a/src/lib/dhcpsrv/subnet.h +++ b/src/lib/dhcpsrv/subnet.h @@ -224,17 +224,6 @@ public: /// @brief Delete all options configured for the subnet. void delOptions(); - /// @brief Return a reference to an empty option container. - /// - /// The empty option container is returned when no other - /// suitable container can be found. For example, this is - /// the case when trying to get a set of options for the - /// particular option space that has no options configured - /// for the subnet. - /// - /// @return reference to the empty option container. - static const OptionContainer& emptyOptionContainer(); - /// @brief checks if the specified address is in pools /// /// Note the difference between inSubnet() and inPool(). For a given