[gnome-software/1744-software-remembers-past-install-intent] gs-app-list: Remove unneeded code in gs_app_list_add_safe()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1744-software-remembers-past-install-intent] gs-app-list: Remove unneeded code in gs_app_list_add_safe()
- Date: Tue, 17 May 2022 12:43:32 +0000 (UTC)
commit 15401122e98c32ab7c675682d739a8953a8f6fa3
Author: Milan Crha <mcrha redhat com>
Date: Tue May 17 14:27:10 2022 +0200
gs-app-list: Remove unneeded code in gs_app_list_add_safe()
While the call to `gs_app_get_unique_id()` can have side-effects,
the function itself does the same thing regardless of the returned
value from the `gs_app_get_unique_id()`, thus avoid that call.
lib/gs-app-list.c | 10 ----------
1 file changed, 10 deletions(-)
---
diff --git a/lib/gs-app-list.c b/lib/gs-app-list.c
index 1de573e1c..c10b04552 100644
--- a/lib/gs-app-list.c
+++ b/lib/gs-app-list.c
@@ -424,21 +424,11 @@ typedef enum {
static void
gs_app_list_add_safe (GsAppList *list, GsApp *app, GsAppListAddFlag flag)
{
- const gchar *id;
-
/* check for duplicate */
if ((flag & GS_APP_LIST_ADD_FLAG_CHECK_FOR_DUPE) > 0 &&
!gs_app_list_check_for_duplicate (list, app))
return;
- /* if we're lazy-loading the ID then we can't use the ID hash */
- id = gs_app_get_unique_id (app);
- if (id == NULL) {
- gs_app_list_maybe_watch_app (list, app);
- g_ptr_array_add (list->array, g_object_ref (app));
- return;
- }
-
/* just use the ref */
gs_app_list_maybe_watch_app (list, app);
g_ptr_array_add (list->array, g_object_ref (app));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]