Re: [PATCH v2 17/29] packed_ref_store: support iteration
- From
Jeff King <peff@peff.net>
- Date
- Jun 23, 2017, 19:12 UTC
- Message-ID
- <20170623191224.s5rkaruv6npbds7q@sigill.intra.peff.net>
- In-Reply-To
- <4171c4ea8b0280fa2c8cee9f1799933f66894f74.1498200513.git.mhagger@alum.mit.edu>
On Fri, Jun 23, 2017 at 09:01:35AM +0200, Michael Haggerty wrote:
> +static int packed_ref_iterator_advance(struct ref_iterator *ref_iterator)
> +{
> + struct packed_ref_iterator *iter =
> + (struct packed_ref_iterator *)ref_iterator;I thought had some kind of safe downcasting mechanism for iterators, but I think I was just thinking of files_downcast() for the ref-store.
I don't mind not having that kind of safety. It seems like an uncommon error to call the packed-ref iterator function on the wrong type, especially as it's static here and only accessible as a virtual function for a packed_ref_iterator.
But something to think about, I guess, as we add more polymorphism.
-Peff