lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 8cdbb16 2/2: Remove code conditioned on failu


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 8cdbb16 2/2: Remove code conditioned on failure of upstream assertions
Date: Sun, 29 Jan 2017 23:52:35 +0000 (UTC)

branch: master
commit 8cdbb1670840ac0d2d8f4724159acceafc41b32e
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Remove code conditioned on failure of upstream assertions
---
 input_sequence.cpp       |    8 --------
 input_sequence_entry.cpp |   10 +++-------
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/input_sequence.cpp b/input_sequence.cpp
index d30d0ec..10c4b62 100644
--- a/input_sequence.cpp
+++ b/input_sequence.cpp
@@ -1037,14 +1037,6 @@ std::string 
InputSequence::element_by_element_representation() const
 //   do we want enumerators e.g. for such tokens?
 std::string InputSequence::mathematical_representation() const
 {
-    if(intervals.empty())
-        {
-        fatal_error()
-            << "Sequence contains no interval."
-            << LMI_FLUSH
-            ;
-        }
-
     std::ostringstream oss;
     for(auto const& interval_i : intervals)
         {
diff --git a/input_sequence_entry.cpp b/input_sequence_entry.cpp
index 92936ef..7def453 100644
--- a/input_sequence_entry.cpp
+++ b/input_sequence_entry.cpp
@@ -427,15 +427,11 @@ void InputSequenceEditor::sequence(InputSequence const& s)
     std::vector<ValueInterval> const& intervals = s.interval_representation();
     int const num_intervals = intervals.size();
 
-    if(intervals.empty())
-        {
-        // have single row (initial state)
-        add_row();
-        return;
-        }
-
+    // Reaffirm InputSequence invariants that are relied upon here:
+    LMI_ASSERT(!intervals.empty());
     LMI_ASSERT(0 == intervals.front().begin_duration);
     LMI_ASSERT(e_maturity == intervals.back().end_mode);
+
     for(int i = 1; i < num_intervals; ++i)
         {
         LMI_ASSERT(intervals[i].begin_duration == intervals[i - 
1].end_duration);



reply via email to

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