From 14082e6b030e11391c429c3e3b878ada717affdd Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 7 Jun 2017 14:46:15 +0100 Subject: [PATCH] lib/pull: Simplify a for-loop initialisation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s a bit neater to initialise the loop iterator and maximum in the same place. Signed-off-by: Philip Withnall Closes: #911 Approved by: cgwalters --- src/libostree/ostree-repo-pull.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 0585eb91..d1826117 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -3174,8 +3174,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, if (pull_data->summary) { refs = g_variant_get_child_value (pull_data->summary, 0); - n = g_variant_n_children (refs); - for (i = 0; i < n; i++) + for (i = 0, n = g_variant_n_children (refs); i < n; i++) { const char *refname; g_autoptr(GVariant) ref = g_variant_get_child_value (refs, i);