reftable/block: introduce macro to initialize struct block_iter
There are a bunch of locations where we initialize members of `struct block_iter`, which makes it harder than necessary to expand this struct to have additional members. Unify the logic via a new `BLOCK_ITER_INIT` macro that initializes all members. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
829231dc20
commit
a8305bc6d8
@ -53,10 +53,10 @@ struct indexed_table_ref_iter {
|
||||
int is_finished;
|
||||
};
|
||||
|
||||
#define INDEXED_TABLE_REF_ITER_INIT \
|
||||
{ \
|
||||
.cur = { .last_key = STRBUF_INIT }, .oid = STRBUF_INIT, \
|
||||
}
|
||||
#define INDEXED_TABLE_REF_ITER_INIT { \
|
||||
.cur = BLOCK_ITER_INIT, \
|
||||
.oid = STRBUF_INIT, \
|
||||
}
|
||||
|
||||
void iterator_from_indexed_table_ref_iter(struct reftable_iterator *it,
|
||||
struct indexed_table_ref_iter *itr);
|
||||
|
Reference in New Issue
Block a user