From: Guilherme Maciel Ferreira Date: Thu, 29 Sep 2011 00:46:42 +0000 (-0300) Subject: Small code improvements X-Git-Tag: v1.3~11^2~34^2~14 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=b7d5b1045f039456640e1f415e66091489a36982;p=pingcheck Small code improvements --- diff --git a/src/config/option/hostconfigurationoption.cpp b/src/config/option/hostconfigurationoption.cpp index f08ecee..9116eac 100644 --- a/src/config/option/hostconfigurationoption.cpp +++ b/src/config/option/hostconfigurationoption.cpp @@ -74,7 +74,8 @@ HostConfigurationOption::~HostConfigurationOption() */ size_t HostConfigurationOption::get_hosts_count() const { - // ensure set_hosts_count was called first + // ensure that the set_hosts_count() was called first, in other words, + // set_hosts_count() MUST be called before get_hosts_count() BOOST_ASSERT( HostsCount != invalid_host_count ); return HostsCount; diff --git a/src/config/option/hostpingintervaloption.cpp b/src/config/option/hostpingintervaloption.cpp index a1b6ecc..5d7ef3d 100644 --- a/src/config/option/hostpingintervaloption.cpp +++ b/src/config/option/hostpingintervaloption.cpp @@ -51,7 +51,7 @@ HostPingIntervalOption::~HostPingIntervalOption() bool HostPingIntervalOption::validate( const variables_map& vm ) const { - bool is_valid = ( vm.count( this->get_command_string() ) > 0 ); + bool is_valid = ( vm.count( get_command_string() ) > 0 ); return is_valid; } diff --git a/src/config/option/hostpingprotocoloption.cpp b/src/config/option/hostpingprotocoloption.cpp index 5993aaa..d725feb 100644 --- a/src/config/option/hostpingprotocoloption.cpp +++ b/src/config/option/hostpingprotocoloption.cpp @@ -51,7 +51,7 @@ HostPingProtocolOption::~HostPingProtocolOption() bool HostPingProtocolOption::validate( const variables_map& vm ) const { - bool is_valid = ( vm.count( this->get_command_string() ) > 0 ); + bool is_valid = ( vm.count( get_command_string() ) > 0 ); return is_valid; } diff --git a/src/config/option/hostportoption.cpp b/src/config/option/hostportoption.cpp index 87c7894..349b4d4 100644 --- a/src/config/option/hostportoption.cpp +++ b/src/config/option/hostportoption.cpp @@ -52,7 +52,7 @@ HostPortOption::~HostPortOption() bool HostPortOption::validate( const variables_map& vm ) const { - bool is_valid = ( vm.count( this->get_command_string() ) > 0 ); + bool is_valid = ( vm.count( get_command_string() ) > 0 ); return is_valid; }