From d3ebe511b843a32fbc0097df0a739d80b3b72f5e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20Dre=C3=9Fler?= Date: Mon, 13 Jul 2026 16:37:56 +0200 Subject: [PATCH] repart: Make use of partitions list being ordered by offsets while looping Let's do the same thing we did above with the last commit here too and make use of the partitions list being ordered by physical offsets. This makes the code a little simpler. --- src/repart/repart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/repart/repart.c b/src/repart/repart.c index d245cab539f..bc6df85b26f 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -1717,15 +1717,12 @@ static int context_grow_partitions_on_free_area(Context *context, FreeArea *a) { Partition *last_partition = NULL; LIST_FOREACH(partitions, p, context->partitions) - if (p->allocated_to_area == a) + if (p->allocated_to_area == a || p->padding_area == a) last_partition = p; if (last_partition) { assert(last_partition->new_padding != UINT64_MAX); last_partition->new_padding += round_down_size(span, context->grain_size); - } else if (a->after) { - assert(a->after->new_padding != UINT64_MAX); - a->after->new_padding += round_down_size(span, context->grain_size); } } -- 2.47.3