citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit aa3b18425b8ddf20e3cf798286a9fa0712875ab5
parent b629c8b321a6696e6322ee63fe979e4964f5be51
Author: Kyle Milz <kyle@0x30.net>
Date:   Tue, 26 Jul 2016 21:33:08 -0600

src: remove duplicate code in term

Diffstat:
Msrc/term_main.cc | 20+++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/term_main.cc b/src/term_main.cc @@ -63,19 +63,21 @@ main(int argc, char *argv[]) total_executions += e; + int color = 0; if (e > 10 * 1000) - attron(COLOR_PAIR(1)); + color = 1; else if (e > 1 * 1000) - attron(COLOR_PAIR(2)); + color = 2; else if (e > 0) - attron(COLOR_PAIR(3)); + color = 3; + + if (color != 0) + attron(COLOR_PAIR(color)); + printw("%s\n", l.c_str()); - if (e > 10 * 1000) - attroff(COLOR_PAIR(1)); - else if (e > 1 * 1000) - attroff(COLOR_PAIR(2)); - else if (e > 0) - attroff(COLOR_PAIR(3)); + + if (color != 0) + attroff(COLOR_PAIR(color)); } move(size_y - 1, 0);