From c4fa052b033c954b77c969aa9caf42cebd3ebd47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Fri, 1 Nov 2019 00:19:38 +0100 Subject: [PATCH] appDisplay: Use _getCategories function instead of duplicating the code We already have a function which gets the categories of an app and handles the null-return case, use it. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/799 --- js/ui/appDisplay.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 3b70cd5c0..8960f6fa8 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -102,10 +102,7 @@ function _findBestFolderName(apps) { let commonCategories = []; appInfos.reduce((categories, appInfo) => { - const appCategories = appInfo.get_categories(); - if (!appCategories) - return categories; - for (let category of appCategories.split(';')) { + for (let category of _getCategories(appInfo)) { if (!(category in categoryCounter)) categoryCounter[category] = 0;