lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] (no subject)


From: Greg Chicares
Subject: [lmi-commits] (no subject)
Date: Sun, 29 May 2016 23:16:41 +0000 (UTC)

branch: master
commit 7c60a41f8afefb52db49f8f4c51a9f9e8ac28f93
Author: Vadim Zeitlin <address@hidden>
Date:   Sun May 1 18:37:22 2016 +0200

    Prefer empty() to 0 == size()
    
    No real changes, but just simplify the code slightly by using a
    dedicated and more clear method for testing whether a standard
    container is empty.
---
 group_values.cpp   |    2 +-
 ihs_mortal.cpp     |    2 +-
 input_sequence.cpp |    2 +-
 product_names.cpp  |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/group_values.cpp b/group_values.cpp
index 109805b..61279d8 100644
--- a/group_values.cpp
+++ b/group_values.cpp
@@ -314,7 +314,7 @@ census_run_result run_census_in_parallel::operator()
             }
         } // End for.
     meter->culminate();
-    if(0 == cell_values.size())
+    if(cell_values.empty())
         {
         // Make sure it's safe to dereference cell_values[0] later.
         fatal_error()
diff --git a/ihs_mortal.cpp b/ihs_mortal.cpp
index 219044a..dc226a5 100644
--- a/ihs_mortal.cpp
+++ b/ihs_mortal.cpp
@@ -217,7 +217,7 @@ void MortalityRates::SetOtherRates()
     // TODO ?? TAXATION !! Do this only if DB_Irc7702NspWhence is 2
     // (which should be an enum). This probably should have its own
     // rounding rule.
-    LMI_ASSERT(0 == CvatNspRates_.size());
+    LMI_ASSERT(CvatNspRates_.empty());
     for(int j = 0; j < Length_; ++j)
         {
         LMI_ASSERT(0.0 < CvatCorridorFactors_[j]);
diff --git a/input_sequence.cpp b/input_sequence.cpp
index 003a4cb..8369bac 100644
--- a/input_sequence.cpp
+++ b/input_sequence.cpp
@@ -706,7 +706,7 @@ void InputSequence::value()
         case e_keyword:
             {
             current_interval.value_is_keyword = true;
-            if(0 == extra_keywords.size())
+            if(extra_keywords.empty())
                 {
                 diagnostics << "Expected number. ";
                 mark_diagnostic_context();
diff --git a/product_names.cpp b/product_names.cpp
index ac5cd20..ea6978d 100644
--- a/product_names.cpp
+++ b/product_names.cpp
@@ -57,7 +57,7 @@ std::vector<std::string> fetch_product_names()
         names.push_back(name);
         }
 
-    if(0 == names.size())
+    if(names.empty())
         {
         fatal_error()
             << "Data directory '"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]