summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-03-26 15:05:03 +0100
committerMaria Matejka <mq@ucw.cz>2022-05-04 15:37:41 +0200
commit58f59d5d9dc11dcc5513ed1fdfcb12c1730b4a19 (patch)
tree8ff75b430349a2715662bf54a70fe914d3b8a954
parent0d0f6554a5c233bf2bf830ae319191c4b1808d49 (diff)
Filters: removing adata_empty() duplicating lp_alloc_adata()
-rw-r--r--filter/data.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/filter/data.c b/filter/data.c
index c3f8bf57..feb8c8bb 100644
--- a/filter/data.c
+++ b/filter/data.c
@@ -93,14 +93,6 @@ const struct f_val f_const_empty_path = {
.val.ad = &null_adata,
};
-static struct adata *
-adata_empty(struct linpool *pool, int l)
-{
- struct adata *res = lp_alloc(pool, sizeof(struct adata) + l);
- res->length = l;
- return res;
-}
-
static void
pm_format(const struct f_path_mask *p, buffer *buf)
{
@@ -423,7 +415,7 @@ clist_filter(struct linpool *pool, const struct adata *list, const struct f_val
if (nl == list->length)
return list;
- struct adata *res = adata_empty(pool, nl);
+ struct adata *res = lp_alloc_adata(pool, nl);
memcpy(res->data, tmp, nl);
return res;
}
@@ -457,7 +449,7 @@ eclist_filter(struct linpool *pool, const struct adata *list, const struct f_val
if (nl == list->length)
return list;
- struct adata *res = adata_empty(pool, nl);
+ struct adata *res = lp_alloc_adata(pool, nl);
memcpy(res->data, tmp, nl);
return res;
}
@@ -489,7 +481,7 @@ lclist_filter(struct linpool *pool, const struct adata *list, const struct f_val
if (nl == list->length)
return list;
- struct adata *res = adata_empty(pool, nl);
+ struct adata *res = lp_alloc_adata(pool, nl);
memcpy(res->data, tmp, nl);
return res;
}