cleanup: Avoid unnecessary parentheses in arrow functions

Parentheses are only needed if there are zero or multiple arguments.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731
This commit is contained in:
Florian Müllner 2019-09-14 17:02:29 +02:00
parent a77377efe7
commit 93525539c2
7 changed files with 7 additions and 7 deletions

View File

@ -269,7 +269,7 @@ const SystemActions = GObject.registerClass({
getMatchingActions(terms) {
// terms is a list of strings
terms = terms.map((term) => term.toLowerCase());
terms = terms.map(term => term.toLowerCase());
let results = [];

View File

@ -1043,7 +1043,7 @@ class WindowList extends SwitcherPopup.SwitcherList {
this.addItem(icon, icon.label);
this.icons.push(icon);
icon._unmanagedSignalId = icon.window.connect('unmanaged', (window) => {
icon._unmanagedSignalId = icon.window.connect('unmanaged', window => {
this._removeWindow(window);
});
}

View File

@ -1073,7 +1073,7 @@ var CalendarMessageList = class CalendarMessageList {
this._clearButton.set_x_align(Clutter.ActorAlign.END);
this._clearButton.connect('clicked', () => {
let sections = [...this._sections.keys()];
sections.forEach((s) => s.clear());
sections.forEach(s => s.clear());
});
box.add_actor(this._clearButton);

View File

@ -549,7 +549,7 @@ var PopupMenuBase = class {
}
_connectItemSignals(menuItem) {
menuItem._activeChangeId = menuItem.connect('notify::active', (menuItem) => {
menuItem._activeChangeId = menuItem.connect('notify::active', menuItem => {
let active = menuItem.active;
if (active && this._activeMenuItem != menuItem) {
if (this._activeMenuItem)

View File

@ -104,7 +104,7 @@ class RunDialog extends ModalDialog.ModalDialog {
this._history = new History.HistoryManager({ gsettingsKey: HISTORY_KEY,
entry: this._entryText });
this._entryText.connect('activate', (o) => {
this._entryText.connect('activate', o => {
this.popModal();
this._run(o.get_text(),
Clutter.get_current_event().get_state() & Clutter.ModifierType.CONTROL_MASK);

View File

@ -713,7 +713,7 @@ var WindowManager = class {
this._isWorkspacePrepended = false;
this._switchData = null;
this._shellwm.connect('kill-switch-workspace', (shellwm) => {
this._shellwm.connect('kill-switch-workspace', shellwm => {
if (this._switchData) {
if (this._switchData.inProgress)
this._switchWorkspaceDone(shellwm);

View File

@ -178,7 +178,7 @@ var WindowMenu = class extends PopupMenu.PopupMenu {
}
let waitId = 0;
let id = global.display.connect('grab-op-end', (display) => {
let id = global.display.connect('grab-op-end', display => {
display.disconnect(id);
GLib.source_remove(waitId);