From 322f6069de6c5e460a0c3b253d36b90ac30bef70 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 9 Jun 2020 06:36:32 +0200 Subject: Cleanup: remove refcount adjusting in sqfs_xattr_writer_end After finding a match, reducing the reference count of the matched elements and increasing them afterwards leaves the reference count identical, because they refere to the same entries. Signed-off-by: David Oberhollenzer --- lib/sqfs/xattr/xattr_writer_record.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'lib/sqfs') diff --git a/lib/sqfs/xattr/xattr_writer_record.c b/lib/sqfs/xattr/xattr_writer_record.c index 5e97868..7cc55b6 100644 --- a/lib/sqfs/xattr/xattr_writer_record.c +++ b/lib/sqfs/xattr/xattr_writer_record.c @@ -112,8 +112,8 @@ int sqfs_xattr_writer_add(sqfs_xattr_writer_t *xwr, const char *key, int sqfs_xattr_writer_end(sqfs_xattr_writer_t *xwr, sqfs_u32 *out) { kv_block_desc_t *blk, *blk_prev; - size_t i, count, value_idx; sqfs_u32 index; + size_t count; int ret; count = xwr->num_pairs - xwr->kv_start; @@ -148,14 +148,6 @@ int sqfs_xattr_writer_end(sqfs_xattr_writer_t *xwr, sqfs_u32 *out) } if (blk != NULL) { - for (i = 0; i < count; ++i) { - value_idx = GET_VALUE(xwr->kv_pairs[xwr->kv_start + i]); - str_table_del_ref(&xwr->values, value_idx); - - value_idx = GET_VALUE(xwr->kv_pairs[blk->start + i]); - str_table_add_ref(&xwr->values, value_idx); - } - xwr->num_pairs = xwr->kv_start; } else { blk = calloc(1, sizeof(*blk)); -- cgit v1.2.3