Subject: Re: [PATCH 5/8] builtin/pack-objects: simplify logic to find kept or nonlocal objects

From: Taylor Blau <[email-masked]>
Date: Wed, 29 Oct 2025 19:15:02 -0400

On Wed, Oct 29, 2025 at 03:55:17PM +0100, Toon Claes wrote:
> > +		/*
> > +		 * We have already checked `last_found`, so there is no need to
> > +		 * re-check here.
> > +		 */
>
> I had to reason with myself why you need to extra `(void *)1` check,
> maybe you can extend the comment a bit:
>
> 		/*
> 		 * When `last_found` was set to something else then
> 		 * `(void *)1` we have already checked it,
> 		 * so there is no need to re-check here.
> 		 */
>
> > +		if (p == last_found && last_found != (void *)1)
> > +			continue;

I wrote above to Patrick that I think the "&& last_found != (void *)1"
part can be dropped, since repo_for_each_pack() should never hand us
such a pointer to begin with.

Thanks,
Taylor