[gnome-software] gs-plugin-loader: Factor out a variable assignment



commit ef9d4f0c5bc3441ae7fc91ad5048d57f6403185d
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Jul 14 13:34:21 2020 +0100

    gs-plugin-loader: Factor out a variable assignment
    
    This makes the following commit a little simpler. It introduces no
    functional changes.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 lib/gs-plugin-loader.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 93ce66f1..1b8e51f7 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -3613,8 +3613,10 @@ gs_plugin_loader_job_process_async (GsPluginLoader *plugin_loader,
        g_return_if_fail (GS_IS_PLUGIN_JOB (plugin_job));
        g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
 
+       action = gs_plugin_job_get_action (plugin_job);
+
        /* check job has valid action */
-       if (gs_plugin_job_get_action (plugin_job) == GS_PLUGIN_ACTION_UNKNOWN) {
+       if (action == GS_PLUGIN_ACTION_UNKNOWN) {
                g_autofree gchar *job_str = gs_plugin_job_to_string (plugin_job);
                task = g_task_new (plugin_loader, cancellable_job, callback, user_data);
                g_task_return_new_error (task,
@@ -3625,7 +3627,6 @@ gs_plugin_loader_job_process_async (GsPluginLoader *plugin_loader,
        }
 
        /* deal with the install queue */
-       action = gs_plugin_job_get_action (plugin_job);
        if (action == GS_PLUGIN_ACTION_REMOVE) {
                if (remove_app_from_install_queue (plugin_loader, gs_plugin_job_get_app (plugin_job))) {
                        GsAppList *list = gs_plugin_job_get_list (plugin_job);


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