cleanup: Only omit braces for single-line blocks

Braces can be avoided when a block consists of a single statement,
but readability suffers when the statement spans more than a single
line.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
This commit is contained in:
Florian Müllner
2019-08-20 02:51:42 +02:00
committed by Georges Basile Stavracas Neto
parent c860409da5
commit 07cc84f632
46 changed files with 178 additions and 101 deletions

View File

@ -61,11 +61,12 @@ function addDragMonitor(monitor) {
}
function removeDragMonitor(monitor) {
for (let i = 0; i < dragMonitors.length; i++)
for (let i = 0; i < dragMonitors.length; i++) {
if (dragMonitors[i] == monitor) {
dragMonitors.splice(i, 1);
return;
}
}
}
var _Draggable = class _Draggable {
@ -555,7 +556,7 @@ var _Draggable = class _Draggable {
};
for (let i = 0; i < dragMonitors.length; i++) {
let dropFunc = dragMonitors[i].dragDrop;
if (dropFunc)
if (dropFunc) {
switch (dropFunc(dropEvent)) {
case DragDropResult.FAILURE:
case DragDropResult.SUCCESS:
@ -563,6 +564,7 @@ var _Draggable = class _Draggable {
case DragDropResult.CONTINUE:
continue;
}
}
}
// At this point it is too late to cancel a drag by destroying