Small code improvements
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Thu, 29 Sep 2011 00:46:42 +0000 (21:46 -0300)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Thu, 29 Sep 2011 00:46:42 +0000 (21:46 -0300)
src/config/option/hostconfigurationoption.cpp
src/config/option/hostpingintervaloption.cpp
src/config/option/hostpingprotocoloption.cpp
src/config/option/hostportoption.cpp

index f08ecee..9116eac 100644 (file)
@@ -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;
index a1b6ecc..5d7ef3d 100644 (file)
@@ -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;
 }
index 5993aaa..d725feb 100644 (file)
@@ -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;
 }
index 87c7894..349b4d4 100644 (file)
@@ -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;
 }