lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 085dd66 3/4: Eradicate a funky iterator


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 085dd66 3/4: Eradicate a funky iterator
Date: Thu, 26 Jan 2017 01:17:21 +0000 (UTC)

branch: master
commit 085dd66558fffb900a6a3e01f5f98c2aa9b9dfc2
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Eradicate a funky iterator
    
    The last interval is more naturally identified as the one that
    extends to the terminal duration. With the test for --end()
    removed, this "while" becomes a "for" that can be modernized.
---
 input_sequence.cpp |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/input_sequence.cpp b/input_sequence.cpp
index e5656a2..a483753 100644
--- a/input_sequence.cpp
+++ b/input_sequence.cpp
@@ -1031,7 +1031,6 @@ std::string InputSequence::mathematical_representation() 
const
     std::ostringstream oss;
     std::vector<ValueInterval>::const_iterator intervals_i = intervals.begin();
     std::vector<ValueInterval>::const_iterator off_the_end = intervals.end();
-    std::vector<ValueInterval>::const_iterator last_interval = --off_the_end;
     while(intervals_i != intervals.end())
         {
         if(intervals_i->value_is_keyword)
@@ -1051,7 +1050,7 @@ std::string InputSequence::mathematical_representation() 
const
             break;
             }
 
-        if(intervals_i != last_interval)
+        if(intervals_i->end_duration != last_possible_duration)
             {
             oss
                 << " ["



reply via email to

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