Commit 95b40069 authored by Florian Müllner's avatar Florian Müllner

apps-menu: Remove unnecessary check

The function is always called with an array parameter (albeit it may
be empty), so remove the unnecessary check and cut down on indentation.

!60
parent bd9f1cfd
......@@ -721,22 +721,20 @@ class ApplicationsButton extends PanelMenu.Button {
}
_displayButtons(apps) {
if (apps) {
for (let i = 0; i < apps.length; i++) {
let app = apps[i];
let item;
if (app instanceof Shell.App)
item = this._applicationsButtons.get(app);
else
item = new PopupMenu.PopupSeparatorMenuItem();
if (!item) {
item = new ApplicationMenuItem(this, app);
item.setDragEnabled(this._desktopTarget.hasDesktop);
this._applicationsButtons.set(app, item);
}
if (!item.actor.get_parent())
this.applicationsBox.add_actor(item.actor);
for (let i = 0; i < apps.length; i++) {
let app = apps[i];
let item;
if (app instanceof Shell.App)
item = this._applicationsButtons.get(app);
else
item = new PopupMenu.PopupSeparatorMenuItem();
if (!item) {
item = new ApplicationMenuItem(this, app);
item.setDragEnabled(this._desktopTarget.hasDesktop);
this._applicationsButtons.set(app, item);
}
if (!item.actor.get_parent())
this.applicationsBox.add_actor(item.actor);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment