Thread (46 messages) 46 messages, 3 authors, 2017-07-01

Re: [PATCH v2 17/29] packed_ref_store: support iteration

flat view

From: Jeff King <hidden>
Date: 2017-06-23 19:12:36

On Fri, Jun 23, 2017 at 09:01:35AM +0200, Michael Haggerty wrote:
quoted hunk ↗ jump to hunk
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help