[gnome-software: 7/24] gs-category-page: Simplify some category code




commit 3dde842f1e6cd2e943ed430d569ad74dce4808c0
Author: Philip Withnall <pwithnall endlessos org>
Date:   Wed Apr 21 16:34:47 2021 +0100

    gs-category-page: Simplify some category code
    
    This introduces no functional changes.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 src/gs-category-page.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
---
diff --git a/src/gs-category-page.c b/src/gs-category-page.c
index 97d8ad365..2e9843df8 100644
--- a/src/gs-category-page.c
+++ b/src/gs-category-page.c
@@ -159,16 +159,9 @@ static void
 gs_category_page_set_featured_apps (GsCategoryPage *self)
 {
        GsCategory *featured_subcat = NULL;
-       GPtrArray *children = gs_category_get_children (self->category);
        g_autoptr(GsPluginJob) plugin_job = NULL;
 
-       for (guint i = 0; i < children->len; ++i) {
-               GsCategory *sub = GS_CATEGORY (g_ptr_array_index (children, i));
-               if (g_strcmp0 (gs_category_get_id (sub), "featured") == 0) {
-                       featured_subcat = sub;
-                       break;
-               }
-       }
+       featured_subcat = gs_category_find_child (self->category, "featured");
 
        if (featured_subcat == NULL)
                return;


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