mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Datafile: Added assert to ::addInterval to confirm redundancy
This commit is contained in:
parent
dca99349d9
commit
32e066a388
1 changed files with 10 additions and 11 deletions
|
@ -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 ();
|
||||
|
||||
|
@ -101,7 +101,6 @@ void Datafile::addInterval (const Interval& interval)
|
|||
_lines.push_back (interval.serialize ());
|
||||
_dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Datafile::deleteInterval (const Interval& interval)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue