Performance

- Moved an expensive operation inside an if statement.
This commit is contained in:
Paul Beckingham 2012-07-25 23:14:15 -04:00
parent d89d51e7e1
commit 39456a3243

View file

@ -213,45 +213,48 @@ static void colorizeKeyword (Task& task, const std::string& rule, const Color& b
////////////////////////////////////////////////////////////////////////////////
static void colorizeDue (Task& task, const Color& base, Color& c)
{
if (task.has ("due"))
{
Task::status status = task.getStatus ();
if (task.has ("due") &&
status != Task::completed &&
if (status != Task::completed &&
status != Task::deleted)
{
if (getDueState (task.get ("due")) == 1)
c.blend (base);
}
}
}
////////////////////////////////////////////////////////////////////////////////
static void colorizeDueToday (Task& task, const Color& base, Color& c)
{
if (task.has ("due"))
{
Task::status status = task.getStatus ();
if (task.has ("due") &&
status != Task::completed &&
if (status != Task::completed &&
status != Task::deleted)
{
if (getDueState (task.get ("due")) == 2)
c.blend (base);
}
}
}
////////////////////////////////////////////////////////////////////////////////
static void colorizeOverdue (Task& task, const Color& base, Color& c)
{
if (task.has ("due"))
{
Task::status status = task.getStatus ();
if (task.has ("due") &&
status != Task::completed &&
if (status != Task::completed &&
status != Task::deleted)
{
if (getDueState (task.get ("due")) == 3)
c.blend (base);
}
}
}
////////////////////////////////////////////////////////////////////////////////
static void colorizeRecurring (Task& task, const Color& base, Color& c)