Change the method used in the compare function 69/301069/4
authorChanggyu Choi <changyu.choi@samsung.com>
Wed, 8 Nov 2023 05:01:52 +0000 (14:01 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Wed, 8 Nov 2023 05:24:31 +0000 (14:24 +0900)
__compare_app_status_for_sorting() needs only pid count.
This patch changes to get pid count method to _app_group_get_count().

Change-Id: Ibcc1592fb7d8fa01dd6560feb37de010b28a9df8
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/modules/ui-core/src/app_group.c

index 020aed2e4f8ee1d300ee794875736db6ea4e849b..a147cf70f09df2037e051ba97015d9f36267ce26 100644 (file)
@@ -2175,8 +2175,6 @@ static gint __compare_app_status_for_sorting(gconstpointer p1, gconstpointer p2)
        amd_app_status_h app_status2 = (amd_app_status_h)p2;
        int app_group_cnt1;
        int app_group_cnt2;
-       int *app_group_pids1;
-       int *app_group_pids2;
        int fg_cnt1;
        int fg_cnt2;
        int timestamp1;
@@ -2199,14 +2197,10 @@ static gint __compare_app_status_for_sorting(gconstpointer p1, gconstpointer p2)
 
        id1 = amd_app_status_get_leader_id(app_status1);
        app_group1 = _app_group_find(id1);
-       _app_group_get_group_pids(app_group1, &app_group_cnt1,
-                       &app_group_pids1);
+       app_group_cnt1 = _app_group_get_count(app_group1);
        id2 = amd_app_status_get_leader_id(app_status2);
        app_group2 = _app_group_find(id2);
-       _app_group_get_group_pids(app_group2, &app_group_cnt2,
-                       &app_group_pids2);
-       free(app_group_pids1);
-       free(app_group_pids2);
+       app_group_cnt2 = _app_group_get_count(app_group2);
 
        if (app_group_cnt1 < app_group_cnt2)
                return 1;