From f6613db5cdd04aa5e3f2ad3f19351a06a60808c5 Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Tue, 8 Dec 2020 21:24:19 +0100 Subject: Additional code simplification Additional correction for #375 --- ProcessList.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'ProcessList.c') diff --git a/ProcessList.c b/ProcessList.c index dc8f62cb..a12e8534 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -479,23 +479,20 @@ void ProcessList_rebuildPanel(ProcessList* this) { int size = ProcessList_size(this); int idx = 0; for (int i = 0; i < size; i++) { - bool hidden = false; Process* p = ProcessList_get(this, i); if ( (!p->show) || (this->userId != (uid_t) -1 && (p->st_uid != this->userId)) || (incFilter && !(String_contains_i(Process_getCommand(p), incFilter))) || (this->pidMatchList && !Hashtable_get(this->pidMatchList, p->tgid)) ) - hidden = true; + continue; - if (!hidden) { - Panel_set(this->panel, idx, (Object*)p); - if ((this->following == -1 && idx == currPos) || (this->following != -1 && p->pid == currPid)) { - Panel_setSelected(this->panel, idx); - this->panel->scrollV = currScrollV; - } - idx++; + Panel_set(this->panel, idx, (Object*)p); + if ((this->following == -1 && idx == currPos) || (this->following != -1 && p->pid == currPid)) { + Panel_setSelected(this->panel, idx); + this->panel->scrollV = currScrollV; } + idx++; } } -- cgit v1.2.3