Consider intervals with trivial end dates

This commit is contained in:
Paul Beckingham 2016-04-11 17:13:14 -04:00
parent 9e4162ecd4
commit 981ef3126d

View file

@ -93,8 +93,9 @@ void Datafile::setExclusions (const std::vector <std::string>& exclusions)
bool Datafile::addInterval (const Interval& interval)
{
// Return false if the interval does not belong in this file.
// Note: end date might be zero.
if (interval.start () > _dayN ||
interval.end () < _day1)
(interval.end ().toEpoch () && interval.end () < _day1))
return false;
if (! _lines_loaded)
@ -116,8 +117,9 @@ bool Datafile::addInterval (const Interval& interval)
bool Datafile::deleteInterval (const Interval& interval)
{
// Return false if the interval does not belong in this file.
// Note: end date might be zero.
if (interval.start () > _dayN ||
interval.end () < _day1)
(interval.end ().toEpoch () && interval.end () < _day1))
return false;
if (! _lines_loaded)