No need to compare values if we know they already changed
Makes for more readable code as well as less code to execute
This commit is contained in:
parent
8979f83e38
commit
2a32e642ed
1 changed files with 7 additions and 16 deletions
|
@ -2202,25 +2202,16 @@ void Workspace::updateClientArea(bool force)
|
|||
}
|
||||
#endif
|
||||
|
||||
bool changed = force;
|
||||
|
||||
if (screenarea.isEmpty())
|
||||
changed = true;
|
||||
|
||||
bool changed = force || screenarea.isEmpty();
|
||||
for (int i = 1;
|
||||
!changed && i <= numberOfDesktops;
|
||||
++i) {
|
||||
if (workarea[ i ] != new_wareas[ i ])
|
||||
changed = true;
|
||||
if (restrictedmovearea[ i ] != new_rmoveareas[ i ])
|
||||
changed = true;
|
||||
if (screenarea[ i ].size() != new_sareas[ i ].size())
|
||||
changed = true;
|
||||
for (int iS = 0;
|
||||
!changed && iS < nscreens;
|
||||
iS ++)
|
||||
if (new_sareas[ i ][ iS ] != screenarea [ i ][ iS ])
|
||||
changed = true;
|
||||
changed |= workarea[i] != new_wareas[i];
|
||||
changed |= restrictedmovearea[i] != new_rmoveareas[i];
|
||||
changed |= screenarea[i].size() != new_sareas[i].size();
|
||||
for (int iS = 0; !changed && iS < nscreens; iS++) {
|
||||
changed |= new_sareas[i][iS] != screenarea[i][iS];
|
||||
}
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
|
|
Loading…
Reference in a new issue