Re: [PATCH v5 09/16] refs/iterator: separate lifecycle from iteration
- From
shejialuo <shejialuo@gmail.com>
- Date
- Mar 12, 2025, 13:45 UTC
- Message-ID
- <Z9GQDJxT1Gu9nzGp@ArchLinux>
- In-Reply-To
- <20250306-pks-update-ref-optimization-v5-9-dcb2ee037e97@pks.im>
On Thu, Mar 06, 2025 at 04:08:40PM +0100, Patrick Steinhardt wrote:
Show 19 quoted lines
> @@ -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) {
> /*