Re: [PATCH 10/10] reftable: make reftable_record a tagged union
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Dec 8, 2021, 14:35 UTC
- Message-ID
- <072ff09c-9174-e769-7ebb-4bb248199337@gmail.com>
- In-Reply-To
- <8deccc3a1dff7e4f7d613fa63d2781fd1f11f841.1638899124.git.gitgitgadget@gmail.com>
On 12/7/2021 12:45 PM, Han-Wen Nienhuys via GitGitGadget wrote:
Show 25 quoted lines
> From: Han-Wen Nienhuys <hanwen@google.com> > > This reduces the amount of glue code, because we don't need a void pointer or > vtable within the structure. > > The only snag is that reftable_index_record contain a strbuf, so it cannot be > zero-initialized. To address this, introduce reftable_record_for() to create a > fresh instance, given a record type. > > Thanks to Peff for the suggestion. > > Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> > --- > reftable/block.c | 4 +- > reftable/block_test.c | 22 +++--- > reftable/generic.c | 35 ++++---- > reftable/iter.c | 4 +- > reftable/merged.c | 37 ++++----- > reftable/pq.c | 3 +- > reftable/pq_test.c | 31 ++++---- > reftable/reader.c | 105 ++++++++++++------------ > reftable/record.c | 176 ++++++++++++++++------------------------- > reftable/record.h | 45 +++++------ > reftable/record_test.c | 162 +++++++++++++++++++------------------ > reftable/writer.c | 46 ++++++-----
This is a HUGE diff, especially compared to the previous changes in this series. I recommend splitting this out into its own series and finding a way to break it down into smaller changes.
Thanks, -Stolee