[gnome-shell-extensions/wip/fmuellner/gtk4: 8/8] use iterators



commit 51bf59236a54f1e81a2b3f11f57cf679377155e7
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed May 20 00:38:43 2020 +0200

    use iterators

 extensions/auto-move-windows/prefs.js   | 6 +-----
 extensions/workspace-indicator/prefs.js | 6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js
index 41f3180..bced45e 100644
--- a/extensions/auto-move-windows/prefs.js
+++ b/extensions/auto-move-windows/prefs.js
@@ -112,11 +112,7 @@ class AutoMoveSettingsWidget extends Gtk.ScrolledWindow {
     }
 
     _getRuleRows() {
-        function *getChildren(list) {
-            for (let c = list.get_first_child(); c; c = c.get_next_sibling())
-                yield c;
-        }
-        return [...getChildren(this._list)].filter(row => !!row.id);
+        return [...this._list].filter(row => !!row.id);
     }
 
     _sync() {
diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js
index 65b94fd..9191068 100644
--- a/extensions/workspace-indicator/prefs.js
+++ b/extensions/workspace-indicator/prefs.js
@@ -97,11 +97,7 @@ class WorkspaceSettingsWidget extends Gtk.ScrolledWindow {
     }
 
     _getWorkspaceRows() {
-        function *getChildren(list) {
-            for (let c = list.get_first_child(); c; c = c.get_next_sibling())
-                yield c;
-        }
-        return [...getChildren(this._list)].filter(row => row.name);
+        return [...this._list].filter(row => row.name);
     }
 
     _sync() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]