perf ui browser: No need to switch char sets that often
Arnaldo Carvalho de Melo [Wed, 26 Oct 2011 10:19:05 +0000 (08:19 -0200)]
Just before and after the loop.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-0lh91cedngyg1pqarbky5vn7@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

tools/perf/util/ui/browser.c

index 29c68ae..8607efa 100644 (file)
@@ -231,13 +231,15 @@ static void ui_browser__scrollbar_set(struct ui_browser *browser)
                       (browser->nr_entries - 1));
        }
 
+       SLsmg_set_char_set(1);
+
        while (h < height) {
                ui_browser__gotorc(browser, row++, col);
-               SLsmg_set_char_set(1);
-               SLsmg_write_char(h == pct ? SLSMG_DIAMOND_CHAR : SLSMG_BOARD_CHAR);
-               SLsmg_set_char_set(0);
+               SLsmg_write_char(h == pct ? SLSMG_DIAMOND_CHAR : SLSMG_CKBRD_CHAR);
                ++h;
        }
+
+       SLsmg_set_char_set(0);
 }
 
 static int __ui_browser__refresh(struct ui_browser *browser)