cleanup: Avoid "lonely" ifs where it makes sense
If an else block only contains an if statement, the two can be combined into an if-else block, which cuts down on indentation and usually helps legibility. There are exceptions (for instance where the outer if and else blocks are mirrored), but where it makes sense, change the code to avoid lonely ifs. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
67ea424525
commit
2e4e2500dd
@ -68,10 +68,11 @@ var XdndHandler = class {
|
||||
// Make sure that the clone has the same position as the source
|
||||
this._cursorWindowClone.add_constraint(constraintPosition);
|
||||
} else {
|
||||
if (this._cursorWindowClone) {
|
||||
this._cursorWindowClone.destroy();
|
||||
this._cursorWindowClone = null;
|
||||
}
|
||||
if (!this._cursorWindowClone)
|
||||
return;
|
||||
|
||||
this._cursorWindowClone.destroy();
|
||||
this._cursorWindowClone = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user