diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-01-16 10:11:56 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-01-16 10:11:57 -0800 |
| commit | 481d69dd63328fb10422c8bf9e714b5b5c7d1820 (patch) | |
| tree | 13eb7caf64e3bfa7bbf6df3bbdd69c718379c0fc /reftable/stack.c | |
| parent | d4dbce1db5cd227a57074bcfc7ec9f0655961bba (diff) | |
| parent | 19b9496c1f0630a4ba252abcdfd313bf9c46347a (diff) | |
| download | git-481d69dd63328fb10422c8bf9e714b5b5c7d1820.tar.xz | |
Merge branch 'ps/reftable-fixes-and-optims'
More fixes and optimizations to the reftable backend.
* ps/reftable-fixes-and-optims:
reftable/merged: transfer ownership of records when iterating
reftable/merged: really reuse buffers to compute record keys
reftable/record: store "val2" hashes as static arrays
reftable/record: store "val1" hashes as static arrays
reftable/record: constify some parts of the interface
reftable/writer: fix index corruption when writing multiple indices
reftable/stack: do not auto-compact twice in `reftable_stack_add()`
reftable/stack: do not overwrite errors when compacting
Diffstat (limited to 'reftable/stack.c')
| -rw-r--r-- | reftable/stack.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/reftable/stack.c b/reftable/stack.c index 16bab82063..7ffeb3ee10 100644 --- a/reftable/stack.c +++ b/reftable/stack.c @@ -425,9 +425,6 @@ int reftable_stack_add(struct reftable_stack *st, return err; } - if (!st->disable_auto_compact) - return reftable_stack_auto_compact(st); - return 0; } @@ -801,18 +798,16 @@ static int stack_write_compact(struct reftable_stack *st, err = 0; break; } - if (err < 0) { - break; - } + if (err < 0) + goto done; if (first == 0 && reftable_ref_record_is_deletion(&ref)) { continue; } err = reftable_writer_add_ref(wr, &ref); - if (err < 0) { - break; - } + if (err < 0) + goto done; entries++; } reftable_iterator_destroy(&it); @@ -827,9 +822,8 @@ static int stack_write_compact(struct reftable_stack *st, err = 0; break; } - if (err < 0) { - break; - } + if (err < 0) + goto done; if (first == 0 && reftable_log_record_is_deletion(&log)) { continue; } @@ -845,9 +839,8 @@ static int stack_write_compact(struct reftable_stack *st, } err = reftable_writer_add_log(wr, &log); - if (err < 0) { - break; - } + if (err < 0) + goto done; entries++; } |
