[gnome-shell] cleanup: Avoid useless return statements
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] cleanup: Avoid useless return statements
- Date: Mon, 16 Sep 2019 20:40:44 +0000 (UTC)
commit a77377efe7c6d4d69bb8b739cd2cbb51ad720e24
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Aug 19 21:37:15 2019 +0200
cleanup: Avoid useless return statements
Return statements are only useful if they return a value or break
the regular function flow (i.e. early returns). Remove all returns
that do neither.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731
js/gdm/batch.js | 1 -
js/ui/appDisplay.js | 1 -
js/ui/main.js | 1 -
js/ui/status/network.js | 1 -
js/ui/windowManager.js | 3 ---
5 files changed, 7 deletions(-)
---
diff --git a/js/gdm/batch.js b/js/gdm/batch.js
index 74af4f0a8e..18662e379e 100644
--- a/js/gdm/batch.js
+++ b/js/gdm/batch.js
@@ -202,7 +202,6 @@ var ConsecutiveBatch = class extends Batch {
hold.disconnect(signalId);
this.nextTask();
});
- return;
} else {
// This task finished, process the next one
this.nextTask();
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 44caf1643a..b98781db08 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -752,7 +752,6 @@ var AllView = class AllView extends BaseAppView {
let maxY = this._adjustment.upper - this._adjustment.page_size;
if (dragEvent.y >= gridBottom && currentY < maxY) {
this.goToPage(this._grid.currentPage + 1);
- return;
}
}
diff --git a/js/ui/main.js b/js/ui/main.js
index 4300dba670..e8269f09be 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -705,7 +705,6 @@ function queueDeferredWork(workId) {
_deferredWorkQueue.push(workId);
if (data.actor.mapped) {
_queueBeforeRedraw(workId);
- return;
} else if (_deferredTimeoutId == 0) {
_deferredTimeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, DEFERRED_TIMEOUT_SECONDS, () =>
{
_runAllDeferredWork();
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 930a20ff52..5d939648f6 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1976,7 +1976,6 @@ var NMApplet = class extends PanelMenu.SystemIndicator {
// or we get to full connectivity through other means
} else if (result == PortalHelperResult.COMPLETED) {
this._closeConnectivityCheck(path);
- return;
} else if (result == PortalHelperResult.RECHECK) {
this._client.check_connectivity_async(null, (client, result) => {
try {
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 7559b6f30f..3df1cd5083 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -1022,7 +1022,6 @@ var WindowManager = class {
(proxy, error) => {
if (error) {
log(error.message);
- return;
}
});
@@ -1682,7 +1681,6 @@ var WindowManager = class {
break;
default:
shellwm.completed_map(actor);
- return;
}
}
@@ -1763,7 +1761,6 @@ var WindowManager = class {
break;
default:
shellwm.completed_destroy(actor);
- return;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]