[gnome-software] trivial: Reduce variable scope



commit c18b7f47bccb9dbb4148ddf6e8362430a1f3c89e
Author: Robert Ancell <robert ancell canonical com>
Date:   Thu Nov 23 10:56:04 2017 +1300

    trivial: Reduce variable scope

 lib/gs-app.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index 16526c2..9c69349 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -387,7 +387,6 @@ gs_app_to_string_append (GsApp *app, GString *str)
        GsAppClass *klass = GS_APP_GET_CLASS (app);
        GsAppPrivate *priv = gs_app_get_instance_private (app);
        AsImage *im;
-       AsScreenshot *ss;
        GList *keys;
        GList *l;
        const gchar *tmp;
@@ -467,8 +466,8 @@ gs_app_to_string_append (GsApp *app, GString *str)
        if (priv->description != NULL)
                gs_app_kv_lpad (str, "description", priv->description);
        for (i = 0; i < priv->screenshots->len; i++) {
+               AsScreenshot *ss = g_ptr_array_index (priv->screenshots, i);
                g_autofree gchar *key = NULL;
-               ss = g_ptr_array_index (priv->screenshots, i);
                tmp = as_screenshot_get_caption (ss, NULL);
                im = as_screenshot_get_image (ss, 0, 0);
                if (im == NULL)


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