Skip to content

Commit

Permalink
kvformat/filterx-func-parse-kv: use optimize() method
Browse files Browse the repository at this point in the history
Signed-off-by: Attila Szakacs <[email protected]>
  • Loading branch information
alltilla committed Jan 2, 2025
1 parent a6ac752 commit 9292cba
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/kvformat/filterx-func-parse-kv.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ _generate(FilterXExprGenerator *s, FilterXObject *fillable)
return result;
}

static FilterXExpr *
_optimize(FilterXExpr *s)
{
FilterXFunctionParseKV *self = (FilterXFunctionParseKV *) s;

self->msg = filterx_expr_optimize(self->msg);
return filterx_generator_function_optimize_method(&self->super);
}

static gboolean
_init(FilterXExpr *s, GlobalConfig *cfg)
{
Expand Down Expand Up @@ -274,6 +283,7 @@ filterx_function_parse_kv_new(FilterXFunctionArgs *args, GError **error)
filterx_generator_function_init_instance(&self->super, "parse_kv");
self->super.super.generate = _generate;
self->super.super.create_container = filterx_generator_create_dict_container;
self->super.super.super.optimize = _optimize;
self->super.super.super.init = _init;
self->super.super.super.deinit = _deinit;
self->super.super.super.free_fn = _free;
Expand Down

0 comments on commit 9292cba

Please sign in to comment.