mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-29 17:07:19 +02:00
Performance
- Moved an expensive operation inside an if statement.
This commit is contained in:
parent
d89d51e7e1
commit
39456a3243
1 changed files with 12 additions and 9 deletions
|
@ -214,43 +214,46 @@ static void colorizeKeyword (Task& task, const std::string& rule, const Color& b
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
static void colorizeDue (Task& task, const Color& base, Color& c)
|
static void colorizeDue (Task& task, const Color& base, Color& c)
|
||||||
{
|
{
|
||||||
|
if (task.has ("due"))
|
||||||
|
{
|
||||||
Task::status status = task.getStatus ();
|
Task::status status = task.getStatus ();
|
||||||
|
if (status != Task::completed &&
|
||||||
if (task.has ("due") &&
|
|
||||||
status != Task::completed &&
|
|
||||||
status != Task::deleted)
|
status != Task::deleted)
|
||||||
{
|
{
|
||||||
if (getDueState (task.get ("due")) == 1)
|
if (getDueState (task.get ("due")) == 1)
|
||||||
c.blend (base);
|
c.blend (base);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
static void colorizeDueToday (Task& task, const Color& base, Color& c)
|
static void colorizeDueToday (Task& task, const Color& base, Color& c)
|
||||||
{
|
{
|
||||||
|
if (task.has ("due"))
|
||||||
|
{
|
||||||
Task::status status = task.getStatus ();
|
Task::status status = task.getStatus ();
|
||||||
|
if (status != Task::completed &&
|
||||||
if (task.has ("due") &&
|
|
||||||
status != Task::completed &&
|
|
||||||
status != Task::deleted)
|
status != Task::deleted)
|
||||||
{
|
{
|
||||||
if (getDueState (task.get ("due")) == 2)
|
if (getDueState (task.get ("due")) == 2)
|
||||||
c.blend (base);
|
c.blend (base);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
static void colorizeOverdue (Task& task, const Color& base, Color& c)
|
static void colorizeOverdue (Task& task, const Color& base, Color& c)
|
||||||
{
|
{
|
||||||
|
if (task.has ("due"))
|
||||||
|
{
|
||||||
Task::status status = task.getStatus ();
|
Task::status status = task.getStatus ();
|
||||||
|
if (status != Task::completed &&
|
||||||
if (task.has ("due") &&
|
|
||||||
status != Task::completed &&
|
|
||||||
status != Task::deleted)
|
status != Task::deleted)
|
||||||
{
|
{
|
||||||
if (getDueState (task.get ("due")) == 3)
|
if (getDueState (task.get ("due")) == 3)
|
||||||
c.blend (base);
|
c.blend (base);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue