From: Derrick Stolee Date: Fri, 20 Mar 2026 16:35:40 GMT Subject: Re: [PATCH v2] commit-reach: simplify cleanup of remaining bitmaps in ahead_behind() Message-ID: In-Reply-To: On 3/19/2026 1:44 PM, Junio C Hamano wrote: > René Scharfe writes: > >> Don't bother extracting the last few remaining prio_queue items in >> order when we only want to free their associated bitmaps; just iterate >> over the item array. > Quite obvious and straightforward. Will queue. Thanks. >> - while (prio_queue_peek(&queue)) { >> - struct commit *c = prio_queue_get(&queue); >> - free_bit_array(c); >> - } >> + for (size_t i = 0; i < queue.nr; i++) >> + free_bit_array(queue.array[i].data); I like this cleanup quite a bit, thanks! I appreciate your self-review on the performance side, too. Thinking out loud like that can help other (e.g. me) avoid similar mistakes in the future. Thanks, -Stolee