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:
Wilhelm Schuermann 2015-10-31 12:05:36 +01:00
parent 5b2328cd6c
commit 3e8cb20284
3 changed files with 77 additions and 27 deletions

View file

@ -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);