summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-06-09 06:36:32 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-06-09 06:36:32 +0200
commit322f6069de6c5e460a0c3b253d36b90ac30bef70 (patch)
tree3288c9a2481c02deaa751f17dfdf45606c565650 /lib
parent1f210bab667a540379243050b5ce3465086e1124 (diff)
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/sqfs/xattr/xattr_writer_record.c10
1 files changed, 1 insertions, 9 deletions
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));