[gnome-software/gnome-3-22] trivial: Refactor gs_app_is_installed to access the state directly



commit cb4b3d31aa11a2fde237d3f35987d4ac939267de
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Wed Oct 19 11:34:49 2016 +0200

    trivial: Refactor gs_app_is_installed to access the state directly
    
    (cherry picked from commit 549c7c91aeedda7f7c52263e2f38992b9a9aaea5)

 src/gs-app.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 0345b2d..fd44ef9 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -2755,12 +2755,10 @@ gs_app_is_installed (GsApp *app)
 
        g_return_val_if_fail (GS_IS_APP (app), FALSE);
 
-       state = gs_app_get_state (app);
-
-       return (state == AS_APP_STATE_INSTALLED) ||
-              (state == AS_APP_STATE_UPDATABLE) ||
-              (state == AS_APP_STATE_UPDATABLE_LIVE) ||
-              (state == AS_APP_STATE_REMOVING);
+       return (app->state == AS_APP_STATE_INSTALLED) ||
+              (app->state == AS_APP_STATE_UPDATABLE) ||
+              (app->state == AS_APP_STATE_UPDATABLE_LIVE) ||
+              (app->state == AS_APP_STATE_REMOVING);
 }
 
 /**


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