[gnome-shell/zbrown/search-change] remoteSearch: Only fetch enabled/disabled list once




commit 17e25af418e27d4cada256216c18756875cdc9b2
Author: Zander Brown <zbrown gnome org>
Date:   Fri Apr 2 04:39:31 2021 +0100

    remoteSearch: Only fetch enabled/disabled list once
    
    GLib should be caching the values but it seems unnecessary to fetch (and marshal) what should be the same 
lists N times instead of just once

 js/ui/remoteSearch.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js
index 77ad317e1e..20869f495e 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -142,14 +142,15 @@ function loadRemoteSearchProviders(searchSettings, callback) {
     // Special case gnome-control-center to be always active and always first
     sortOrder.unshift('gnome-control-center.desktop');
 
+    let disabled = searchSettings.get_strv('disabled');
+    let enabled = searchSettings.get_strv('enabled');
+
     loadedProviders = loadedProviders.filter(provider => {
         let appId = provider.appInfo.get_id();
 
         if (provider.defaultEnabled) {
-            let disabled = searchSettings.get_strv('disabled');
             return !disabled.includes(appId);
         } else {
-            let enabled = searchSettings.get_strv('enabled');
             return enabled.includes(appId);
         }
     });


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