[gnome-software: 13/25] gs-plugin-job-refine: Remove unnecessary app list copy
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 13/25] gs-plugin-job-refine: Remove unnecessary app list copy
- Date: Tue, 1 Mar 2022 12:28:12 +0000 (UTC)
commit 55872b0e718efc0e48eecc902a2762ece13f28fd
Author: Philip Withnall <pwithnall endlessos org>
Date: Thu Feb 24 15:38:39 2022 +0000
gs-plugin-job-refine: Remove unnecessary app list copy
The `self->app_list` is never modified after construction of the
`GsPluginJobRefine`, so is safe to use as the freeze list and the thaw
list.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
Helps: #1658
lib/gs-plugin-job-refine.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/lib/gs-plugin-job-refine.c b/lib/gs-plugin-job-refine.c
index 0ea3b6ab9..f5cc9604c 100644
--- a/lib/gs-plugin-job-refine.c
+++ b/lib/gs-plugin-job-refine.c
@@ -370,7 +370,6 @@ gs_plugin_job_refine_run_async (GsPluginJob *job,
g_autoptr(GError) local_error = NULL;
g_autofree gchar *job_debug = NULL;
g_autoptr(GsAppList) result_list = NULL;
- g_autoptr(GsAppList) freeze_list = NULL;
/* check required args */
task = g_task_new (job, cancellable, callback, user_data);
@@ -389,9 +388,8 @@ gs_plugin_job_refine_run_async (GsPluginJob *job,
goto results;
/* freeze all apps */
- freeze_list = gs_app_list_copy (result_list);
- for (guint i = 0; i < gs_app_list_length (freeze_list); i++) {
- GsApp *app = gs_app_list_index (freeze_list, i);
+ for (guint i = 0; i < gs_app_list_length (self->app_list); i++) {
+ GsApp *app = gs_app_list_index (self->app_list, i);
g_object_freeze_notify (G_OBJECT (app));
}
@@ -428,8 +426,8 @@ gs_plugin_job_refine_run_async (GsPluginJob *job,
}
/* now emit all the changed signals */
- for (guint i = 0; i < gs_app_list_length (freeze_list); i++) {
- GsApp *app = gs_app_list_index (freeze_list, i);
+ for (guint i = 0; i < gs_app_list_length (self->app_list); i++) {
+ GsApp *app = gs_app_list_index (self->app_list, i);
g_idle_add (app_thaw_notify_idle, g_object_ref (app));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]