Datafile: Added assert to ::addInterval to confirm redundancy

This commit is contained in:
Paul Beckingham 2016-04-29 18:22:25 -04:00
parent dca99349d9
commit 32e066a388

View file

@ -29,6 +29,7 @@
#include <format.h>
#include <algorithm>
#include <sstream>
#include <cassert>
#include <stdlib.h>
////////////////////////////////////////////////////////////////////////////////
@ -87,10 +88,9 @@ std::vector <std::string> Datafile::allLines ()
// Accepted intervals; day1 <= interval.start < dayN
void Datafile::addInterval (const Interval& interval)
{
// Return false if the interval does not belong in this file.
// Note: end date might be zero.
if (_range.overlap (interval.range))
{
assert (_range.overlap (interval.range));
if (! _lines_loaded)
load_lines ();
@ -100,7 +100,6 @@ void Datafile::addInterval (const Interval& interval)
_lines.push_back (interval.serialize ());
_dirty = true;
}
}
////////////////////////////////////////////////////////////////////////////////