Re: [PATCH 10/10] reftable: make reftable_record a tagged union
From: Han-Wen Nienhuys <hidden>
Date: 2021-12-08 17:52:12
On Wed, Dec 8, 2021 at 5:47 PM Junio C Hamano [off-list ref] wrote:
Perhaps reftable_record_for() can be implemented without changing the shape of the underlying reftable_record structure in an earlier step, then all the users of reftable_record instances can be migrated to call it, and then finally the shape of the structure and the implementation of reftable_record_for() can be updated?
We are going from
reftable_ref_record ref = { 0 };
reftable_record rec = { 0 };
record_from_ref_record(&rec, &ref);
to
reftable_record rec = { .type = BLOCK_TYPE_REF };
which is why this change is so nice. reftable_record_for() is used in
just a few places, so it wouldn't make the change much smaller.
--
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--
Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado