From b645a4371c3173fedff7274211b6834195a7ac18 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 21 Jul 2015 09:05:22 +0200 Subject: flowtop: Simplify assignment of flow_entry->is_visible Just assign a default value of false and override it with true if the checks go through. Signed-off-by: Tobias Klauser --- flowtop.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/flowtop.c b/flowtop.c index bf2e585..f0f36c6 100644 --- a/flowtop.c +++ b/flowtop.c @@ -936,32 +936,30 @@ static void presenter_screen_update(WINDOW *screen, struct flow_list *fl, "Is netfilter running?)"); for (; n; n = rcu_dereference(n->next)) { + n->is_visible = false; if (presenter_get_port(n->port_src, n->port_dst, 0) == 53) - goto skip; + continue; if (presenter_flow_wrong_state(n)) - goto skip; + continue; /* count only flows which might be showed */ flows++; if (maxy <= 0) - goto skip; + continue; if (skip_left > 0) { skip_left--; - goto skip; + continue; } + n->is_visible = true; + presenter_screen_do_line(screen, n, &line); line++; maxy -= (2 + 1 * show_src); - n->is_visible = true; - continue; -skip: - n->is_visible = false; - continue; } mvwprintw(screen, 1, 2, "Kernel netfilter flows(%u) for %s%s%s%s%s%s" -- cgit v1.2.3-54-g00ecf