lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 6d90720 2/4: Prefer empty() to size()


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 6d90720 2/4: Prefer empty() to size()
Date: Wed, 1 Feb 2017 12:43:14 +0000 (UTC)

branch: master
commit 6d90720099449eaa0c4d7f4efabb3a522f84bc71
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Prefer empty() to size()
---
 input_sequence.cpp |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/input_sequence.cpp b/input_sequence.cpp
index 1e30b50..2ffe4dd 100644
--- a/input_sequence.cpp
+++ b/input_sequence.cpp
@@ -136,9 +136,9 @@ InputSequence::InputSequence(std::vector<double> const& v)
     ValueInterval dummy;
 
     double prior_value =
-        (0 != v.size())
-        ? v.front()
-        : 0.0
+        v.empty()
+        ? 0.0
+        : v.front()
         ;
     double current_value = prior_value;
 
@@ -173,9 +173,9 @@ InputSequence::InputSequence(std::vector<std::string> 
const& v)
     dummy.value_is_keyword = true;
 
     std::string prior_value =
-        (0 != v.size())
-        ? v.front()
-        : std::string()
+        v.empty()
+        ? std::string()
+        : v.front()
         ;
     std::string current_value = prior_value;
 
@@ -220,16 +220,16 @@ InputSequence::InputSequence
     ValueInterval dummy;
 
     double n_prior_value =
-        (0 != n_v.size())
-        ? n_v.front()
-        : 0.0
+        n_v.empty()
+        ? 0.0
+        : n_v.front()
         ;
     double n_current_value = n_prior_value;
 
     std::string s_prior_value =
-        (0 != s_v.size())
-        ? s_v.front()
-        : std::string()
+        s_v.empty()
+        ? std::string()
+        : s_v.front()
         ;
     std::string s_current_value = s_prior_value;
 
@@ -291,7 +291,7 @@ void InputSequence::realize_vector()
     keyword_result = s;
 
     // Vectors have default values if the input expression could not be parsed.
-    if(formatted_diagnostics().size())
+    if(!formatted_diagnostics().empty())
         {
         return;
         }



reply via email to

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