Re: [PATCH 3/8] trailer: add interface for iterating over commit trailers
- From
Jeff King <peff@peff.net>
- Date
- Sep 27, 2020, 08:20 UTC
- Message-ID
- <20200927082051.GA1292450@coredump.intra.peff.net>
- In-Reply-To
- <CAN0heSrhmf9-Ep+SWe7Wy-7c3M9-1NFBybSA=6aJ1vDYGTdciA@mail.gmail.com>
On Sat, Sep 26, 2020 at 02:39:32PM +0200, Martin Ågren wrote:
Show 9 quoted lines
> > +/* > > + * Initialize "iter" in preparation for walking over the trailers in the commit > > + * message "msg". The "msg" pointer must remain valid until the iterator is > > + * released. > > + * > > + * After initializing, we are not yet pointing > > + */ > > Truncated sentence. "... not yet pointing at any trailer"?
Oops. Yes, though I expanded it to:
* After initializing, note that key/val will not yet point to any trailer. * Call advance() to parse the first one (if any).
Obviously another convention would be:
for (trailer_iterator_init(&iter, msg);
!trailer_iterator_done();
trailer_iterator_advance()) {
}but I don't think it matters much either way as long as it's clearly documented.
-Peff