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

@ -437,13 +437,13 @@ var InputSourceManager = class {
this.emit('current-source-changed', oldSource);
for (let i = 1; i < this._mruSources.length; ++i)
for (let i = 1; i < this._mruSources.length; ++i) {
if (this._mruSources[i] == newSource) {
let currentSource = this._mruSources.splice(i, 1);
this._mruSources = currentSource.concat(this._mruSources);
break;
}
}
this._changePerWindowSource();
}
@ -516,12 +516,13 @@ var InputSourceManager = class {
let mruSources = [];
for (let i = 0; i < this._mruSources.length; i++) {
for (let j = 0; j < sourcesList.length; j++)
for (let j = 0; j < sourcesList.length; j++) {
if (this._mruSources[i].type == sourcesList[j].type &&
this._mruSources[i].id == sourcesList[j].id) {
mruSources = mruSources.concat(sourcesList.splice(j, 1));
break;
}
}
}
this._mruSources = mruSources.concat(sourcesList);
}