Remove duplicated if condition

The for loop already handles i being < nPanels

Raised by cppcheck
This commit is contained in:
Alan Barr 2018-10-13 19:04:59 +01:00 committed by Hisham Muhammad
parent 67e368914a
commit c39f710b52
1 changed files with 3 additions and 5 deletions

View File

@ -145,14 +145,12 @@ static void checkRecalculation(ScreenManager* this, double* oldTime, int* sortTi
} }
static void ScreenManager_drawPanels(ScreenManager* this, int focus) { static void ScreenManager_drawPanels(ScreenManager* this, int focus) {
int nPanels = this->panelCount; const int nPanels = this->panelCount;
for (int i = 0; i < nPanels; i++) { for (int i = 0; i < nPanels; i++) {
Panel* panel = (Panel*) Vector_get(this->panels, i); Panel* panel = (Panel*) Vector_get(this->panels, i);
Panel_draw(panel, i == focus); Panel_draw(panel, i == focus);
if (i < nPanels) { if (this->orientation == HORIZONTAL) {
if (this->orientation == HORIZONTAL) { mvvline(panel->y, panel->x+panel->w, ' ', panel->h+1);
mvvline(panel->y, panel->x+panel->w, ' ', panel->h+1);
}
} }
} }
} }