From a8305bc6d8eb55cf52264964c8fc0289b72f2fd8 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Mon, 11 Dec 2023 10:08:07 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- reftable/block.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'reftable/block.c') diff --git a/reftable/block.c b/reftable/block.c index 34d4d07369..8c6a8c77fc 100644 --- a/reftable/block.c +++ b/reftable/block.c @@ -389,9 +389,7 @@ int block_reader_seek(struct block_reader *br, struct block_iter *it, struct reftable_record rec = reftable_new_record(block_reader_type(br)); struct strbuf key = STRBUF_INIT; int err = 0; - struct block_iter next = { - .last_key = STRBUF_INIT, - }; + struct block_iter next = BLOCK_ITER_INIT; int i = binsearch(br->restart_count, &restart_key_less, &args); if (args.error) { -- cgit v1.3-5-g9baa