Add Task.is_empty, needed to identify "dummy" tasks (simple refactor)

getDOM takes an &Task that may be a reference to a dummy, or may be a
real task.  The is_empty method replaces `task.data.size() == 0` as a
way to distinguish the two.
This commit is contained in:
Dustin J. Mitchell
2021-11-18 02:17:24 +00:00
committed by Tomas Babej
parent dede40bc4e
commit 0d9e402d3e
3 changed files with 24 additions and 11 deletions

View File

@@ -363,6 +363,14 @@ Task::dateState Task::getDateState (const std::string& name) const
return dateNotDue;
}
////////////////////////////////////////////////////////////////////////////////
// An empty task is typically a "dummy", such as in DOM evaluation, which may or
// may not occur in the context of a task.
bool Task::is_empty () const
{
return data.size () == 0;
}
////////////////////////////////////////////////////////////////////////////////
// Ready means pending, not blocked and either not scheduled or scheduled before
// now.