Non-bug patch



Is there a standard way to send a patch, without a bug report?

I was just working on an extension, and saw an opportunity to make a
small code reusability improvement in appDisplay.js.

The patch is attached, in case any developers see it here.
From 8666001c69f0d4c6a2f169091d10c6a64537e6b4 Mon Sep 17 00:00:00 2001
From: Sam Bull <sam sambull org>
Date: Sun, 10 Feb 2013 15:55:30 +0000
Subject: [PATCH] Minor improvement to code reusability.

---
 js/ui/appDisplay.js |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 2449645..2877f87 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -108,17 +108,14 @@ const AlphabeticalView = new Lang.Class({
     },
 
     setVisibleApps: function(apps) {
-        if (apps == null) { // null implies "all"
-            for (var id in this._appIcons) {
-                var icon = this._appIcons[id];
-                icon.actor.visible = true;
-            }
-        } else {
-            // Set everything to not-visible, then set to visible what we should see
-            for (var id in this._appIcons) {
-                var icon = this._appIcons[id];
-                icon.actor.visible = false;
-            }
+        let allApps = (apps == null);
+        for (var id in this._appIcons) {
+            var icon = this._appIcons[id];
+            icon.actor.visible = allApps;
+        }
+        if (!allApps) {
+            // Set everything to not-visible above,
+            // then, below, set to visible what we should see
             for (var i = 0; i < apps.length; i++) {
                 var app = apps[i];
                 var id = app.get_id();
-- 
1.7.10.4

Attachment: signature.asc
Description: This is a digitally signed message part



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