From 1cce8cbf63c82e4eeaa564da31cf9af7bafafd27 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Mon, 30 Jun 2025 17:14:05 +0200 Subject: [PATCH] core/transaction: inline one iterator var --- src/core/transaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/transaction.c b/src/core/transaction.c index 0fc82f6716c..01ca67553ff 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -369,8 +369,8 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi /* Have we seen this before? */ if (j->generation == generation) { - Job *k, *delete = NULL; _cleanup_free_ char **array = NULL, *unit_ids = NULL; + Job *delete = NULL; /* If the marker is NULL we have been here already and decided the job was loop-free from * here. Hence shortcut things and return right-away. */ @@ -380,7 +380,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi /* So, the marker is not NULL and we already have been here. We have a cycle. Let's try to * break it. We go backwards in our path and try to find a suitable job to remove. We use the * marker to find our way back, since smart how we are we stored our way back in there. */ - for (k = from; k; k = ((k->generation == generation && k->marker != k) ? k->marker : NULL)) { + for (Job *k = from; k; k = (k->generation == generation && k->marker != k) ? k->marker : NULL) { /* For logging below */ if (strv_push_pair(&array, k->unit->id, (char*) job_type_to_string(k->type)) < 0) -- 2.47.3