From 79c939eb8413847b287e5d0ec0e7630e571d3a20 Mon Sep 17 00:00:00 2001 From: Alan Barr Date: Sat, 13 Oct 2018 19:04:59 +0100 Subject: [PATCH] Remove duplicated if condition The for loop already handles i being < nPanels Raised by cppcheck --- ScreenManager.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ScreenManager.c b/ScreenManager.c index 05e1c024..06e90193 100644 --- a/ScreenManager.c +++ b/ScreenManager.c @@ -145,14 +145,12 @@ static void checkRecalculation(ScreenManager* this, double* oldTime, int* sortTi } static void ScreenManager_drawPanels(ScreenManager* this, int focus) { - int nPanels = this->panelCount; + const int nPanels = this->panelCount; for (int i = 0; i < nPanels; i++) { Panel* panel = (Panel*) Vector_get(this->panels, i); Panel_draw(panel, i == focus); - if (i < nPanels) { - if (this->orientation == HORIZONTAL) { - mvvline(panel->y, panel->x+panel->w, ' ', panel->h+1); - } + if (this->orientation == HORIZONTAL) { + mvvline(panel->y, panel->x+panel->w, ' ', panel->h+1); } } }