Re: [PATCH v5 09/16] refs/iterator: separate lifecycle from iteration
On Wed, Mar 12, 2025 at 09:45:48PM +0800, shejialuo wrote:
Show 24 quoted lines
> 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.Yeah, let's. I'll add it back in.
Patrick