Commit 2a32e642 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

No need to compare values if we know they already changed

Makes for more readable code as well as less code to execute
parent 8979f83e
......@@ -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) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment