mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-07 21:07:20 +02:00
Color: Improve colorize() performance
- Improves "render" time by ~45-55% across relevant performance tests. - Improves "list" performance test by ~20%. - Improves "all" performance test by ~40%.
This commit is contained in:
parent
5b2328cd6c
commit
3e8cb20284
3 changed files with 77 additions and 27 deletions
|
@ -354,7 +354,7 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
if (c)
|
||||
{
|
||||
if (row_color.nontrivial ())
|
||||
out += row_color.colorize (intra);
|
||||
row_color._colorize (out, intra);
|
||||
else
|
||||
out += (odd ? intra_odd : intra_even);
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ std::string ViewTask::render (std::vector <Task>& data, std::vector <int>& seque
|
|||
if (i < cells[c].size ())
|
||||
out += cells[c][i];
|
||||
else
|
||||
out += row_color.colorize (std::string (widths[c], ' '));
|
||||
row_color._colorize (out, std::string (widths[c], ' '));
|
||||
}
|
||||
|
||||
out += (odd ? extra_odd : extra_even);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue