Patrick Steinhardt <ps@xxxxxx> writes: [snip] > diff --git a/reftable/stack.c b/reftable/stack.c > index 64c7fdf8c4..7f4e267ea9 100644 > --- a/reftable/stack.c > +++ b/reftable/stack.c > @@ -225,13 +225,11 @@ static int reftable_stack_reload_once(struct reftable_stack *st, > const char **names, > int reuse_open) > { > - size_t cur_len = !st->merged ? 0 : st->merged->stack_len; > + size_t cur_len = !st->merged ? 0 : st->merged->readers_len; > struct reftable_reader **cur = stack_copy_readers(st, cur_len); > size_t names_len = names_length(names); > struct reftable_reader **new_readers = > reftable_calloc(names_len, sizeof(*new_readers)); > - struct reftable_table *new_tables = > - reftable_calloc(names_len, sizeof(*new_tables)); > Before we had both `reftable_reader` and `reftable_table` here and we used to set `reftable_table` from the reader and use it to create a merged table. Now we will simply use the readers directly. > size_t new_readers_len = 0; > struct reftable_merged_table *new_merged = NULL; > struct strbuf table_path = STRBUF_INIT; > @@ -267,17 +265,15 @@ static int reftable_stack_reload_once(struct reftable_stack *st, > } > > new_readers[new_readers_len] = rd; > - reftable_table_from_reader(&new_tables[new_readers_len], rd); This being the part where we convert `reftable_reader` array to `reftable_table` array. > new_readers_len++; > } > > /* success! */ > - err = reftable_merged_table_new(&new_merged, new_tables, > + err = reftable_merged_table_new(&new_merged, new_readers, > new_readers_len, st->opts.hash_id); > And this being the part where we create the merged table. > if (err < 0) > goto done; > > - new_tables = NULL; > st->readers_len = new_readers_len; > if (st->merged) > reftable_merged_table_free(st->merged); > @@ -309,7 +305,6 @@ static int reftable_stack_reload_once(struct reftable_stack *st, [snip] The entire patch is along the lines of what I explained above, so looks good!
Attachment:
signature.asc
Description: PGP signature