diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-01-16 21:11:56 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-01-16 21:11:57 +0300 |
commit | 481d69dd63328fb10422c8bf9e714b5b5c7d1820 (patch) | |
tree | 13eb7caf64e3bfa7bbf6df3bbdd69c718379c0fc /reftable/merged_test.c | |
parent | d4dbce1db5cd227a57074bcfc7ec9f0655961bba (diff) | |
parent | 19b9496c1f0630a4ba252abcdfd313bf9c46347a (diff) |
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/merged_test.c')
-rw-r--r-- | reftable/merged_test.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/reftable/merged_test.c b/reftable/merged_test.c index 0d6e0d4bf5..46908f738f 100644 --- a/reftable/merged_test.c +++ b/reftable/merged_test.c @@ -122,13 +122,11 @@ static void readers_destroy(struct reftable_reader **readers, size_t n) static void test_merged_between(void) { - uint8_t hash1[GIT_SHA1_RAWSZ] = { 1, 2, 3, 0 }; - struct reftable_ref_record r1[] = { { .refname = "b", .update_index = 1, .value_type = REFTABLE_REF_VAL1, - .value.val1 = hash1, + .value.val1 = { 1, 2, 3, 0 }, } }; struct reftable_ref_record r2[] = { { .refname = "a", @@ -164,26 +162,24 @@ static void test_merged_between(void) static void test_merged(void) { - uint8_t hash1[GIT_SHA1_RAWSZ] = { 1 }; - uint8_t hash2[GIT_SHA1_RAWSZ] = { 2 }; struct reftable_ref_record r1[] = { { .refname = "a", .update_index = 1, .value_type = REFTABLE_REF_VAL1, - .value.val1 = hash1, + .value.val1 = { 1 }, }, { .refname = "b", .update_index = 1, .value_type = REFTABLE_REF_VAL1, - .value.val1 = hash1, + .value.val1 = { 1 }, }, { .refname = "c", .update_index = 1, .value_type = REFTABLE_REF_VAL1, - .value.val1 = hash1, + .value.val1 = { 1 }, } }; struct reftable_ref_record r2[] = { { @@ -196,13 +192,13 @@ static void test_merged(void) .refname = "c", .update_index = 3, .value_type = REFTABLE_REF_VAL1, - .value.val1 = hash2, + .value.val1 = { 2 }, }, { .refname = "d", .update_index = 3, .value_type = REFTABLE_REF_VAL1, - .value.val1 = hash1, + .value.val1 = { 1 }, }, }; |