From 9bb1dbbd4df7ec27f70b15d59d3972776dae2866 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 20 Sep 2014 14:11:59 -0400 Subject: [PATCH] ViewTask - Improved locality, for readability, while debugging column TW-1417. --- src/ViewTask.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ViewTask.cpp b/src/ViewTask.cpp index f7a17b197..414ddd90a 100644 --- a/src/ViewTask.cpp +++ b/src/ViewTask.cpp @@ -170,7 +170,6 @@ std::string ViewTask::render (std::vector & data, std::vector & seque int sum_minimal = std::accumulate (minimal.begin (), minimal.end (), 0); int sum_ideal = std::accumulate (ideal.begin (), ideal.end (), 0); - // Calculate final column widths. int overage = _width - sum_minimal - all_extra; context.debug (format ("ViewTask::render min={1} ideal={2} overage={3} width={4}", @@ -234,10 +233,6 @@ std::string ViewTask::render (std::vector & data, std::vector & seque max_lines = headers[c].size (); } - // Output string. - std::string out; - _lines = 0; - // Render column headers. std::string left_margin = std::string (_left_margin, ' '); std::string extra = std::string (_extra_padding, ' '); @@ -248,6 +243,8 @@ std::string ViewTask::render (std::vector & data, std::vector & seque std::string intra_odd = context.color () ? _intra_odd.colorize (intra) : intra; std::string intra_even = context.color () ? _intra_even.colorize (intra) : intra; + std::string out; + _lines = 0; for (unsigned int i = 0; i < max_lines; ++i) { out += left_margin + extra;