apps-menu: Minor cleanup

We have a much more idiomatic way of transforming one array
into another than pushing values while iterating over the
original array ...

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
This commit is contained in:
Florian Müllner
2019-08-07 04:11:30 +02:00
committed by Florian Müllner
parent 2655419880
commit 4007b61cf2
+3 -7
View File
@@ -683,13 +683,9 @@ class ApplicationsButton extends PanelMenu.Button {
if (categoryMenuId) {
applist = this.applicationsByCategory[categoryMenuId];
} else {
applist = new Array();
let favorites = global.settings.get_strv('favorite-apps');
for (let i = 0; i < favorites.length; i++) {
let app = appSys.lookup_app(favorites[i]);
if (app)
applist.push(app);
}
applist = global.settings.get_strv('favorite-apps')
.map(id => appSys.lookup_app(id))
.filter(app => app);
}
return applist;