Subject: Re: [PATCH v5 09/16] refs/iterator: separate lifecycle from iteration

From: shejialuo <[email-masked]>
Date: Wed, 12 Mar 2025 21:45:48 +0800

On Thu, Mar 06, 2025 at 04:08:40PM +0100, Patrick Steinhardt wrote:

> @@ -350,19 +338,10 @@ static int prefix_ref_iterator_advance(struct ref_iterator *ref_iterator)
>  
>  	while ((ok = ref_iterator_advance(iter->iter0)) == ITER_OK) {
>  		int cmp = compare_prefix(iter->iter0->refname, iter->prefix);
> -
>  		if (cmp < 0)
>  			continue;
> -
> -		if (cmp > 0) {
> -			/*
> -			 * As the source iterator is ordered, we
> -			 * can stop the iteration as soon as we see a
> -			 * refname that comes after the prefix:
> -			 */
> -			ok = ref_iterator_abort(iter->iter0);
> -			break;
> -		}
> +		if (cmp > 0)
> +			return ITER_DONE;

Should we maintain the above comment? Why do we delete the comment. I
somehow think the comment makes sense.

>  		if (iter->trim) {
>  			/*