From 90c2a028cf2769907174144c77db2e267a341fdf Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 21 Jun 2010 12:44:42 -0300 Subject: [PATCH] --- yaml --- r: 205279 b: refs/heads/master c: 8c694d2559acf09bfd8b71fe1795e740063ad803 h: refs/heads/master i: 205277: 445777eafa619aff6eb916d5c8dbc24075bf4240 205275: 0565650add6ae61cadf2b43b9551f36e84781b56 205271: 9f5b4b524ac3d292346f34dbcde47ea3b56fd2b9 205263: 82c1e01f57579f48fddf12447c9e508ed1d4691f 205247: 146a675d26d350cc388465740a2fea314c403631 v: v3 --- [refs] | 2 +- trunk/tools/perf/util/newt.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 2567c0cf071f..0e3c3b4d82bb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bfde744863eab22a3a400c9003f4f555c903f61d +refs/heads/master: 8c694d2559acf09bfd8b71fe1795e740063ad803 diff --git a/trunk/tools/perf/util/newt.c b/trunk/tools/perf/util/newt.c index cf182ca132fe..1e774e7f2281 100644 --- a/trunk/tools/perf/util/newt.c +++ b/trunk/tools/perf/util/newt.c @@ -270,6 +270,11 @@ struct ui_browser { u32 nr_entries; }; +static bool ui_browser__is_current_entry(struct ui_browser *self, unsigned row) +{ + return (self->first_visible_entry_idx + row) == self->index; +} + static void ui_browser__refresh_dimensions(struct ui_browser *self) { int cols, rows; @@ -286,8 +291,8 @@ static void ui_browser__refresh_dimensions(struct ui_browser *self) static void ui_browser__reset_index(struct ui_browser *self) { - self->index = self->first_visible_entry_idx = 0; - self->first_visible_entry = NULL; + self->index = self->first_visible_entry_idx = 0; + self->first_visible_entry = NULL; } static int objdump_line__show(struct objdump_line *self, struct list_head *head, @@ -353,7 +358,7 @@ static int ui_browser__refresh_entries(struct ui_browser *self) pos = list_entry(self->first_visible_entry, struct objdump_line, node); list_for_each_entry_from(pos, head, node) { - bool current_entry = (self->first_visible_entry_idx + row) == self->index; + bool current_entry = ui_browser__is_current_entry(self, row); SLsmg_gotorc(self->top + row, self->left); objdump_line__show(pos, head, self->width, he, len, current_entry);