diff options
author | Alan Barr <a.barr@outlook.com> | 2018-10-13 19:04:59 +0100 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-02-10 14:16:46 +0100 |
commit | 79c939eb8413847b287e5d0ec0e7630e571d3a20 (patch) | |
tree | d18d5c5742cc8c0a794da3945afbd43efcb77f3c /ScreenManager.c | |
parent | dc7d0352383c41eda15510ae6995ea75c3a2259d (diff) |
Remove duplicated if condition
The for loop already handles i being < nPanels
Raised by cppcheck
Diffstat (limited to 'ScreenManager.c')
-rw-r--r-- | ScreenManager.c | 8 |
1 files 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); } } } |