c_client.py: Use get_expr_field_names directly to resolve list fields

Using get_expr_fields() is only needed in case we are doing things that
can span multiple types easily, e.g. when deciding what data to pass via
function parameters and so on.

In _c_serialize_helper_list_field() we are building function body, so
acquiring field names via get_expr_field_names() is enough.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
This commit is contained in:
Povilas Kanapickas 2021-07-30 22:58:45 +03:00
parent 4d678b162b
commit 068af21cb3

View File

@ -977,7 +977,7 @@ def _c_serialize_helper_list_field(context, self, field,
param_fields, wire_fields, params = get_serialize_params('sizeof', self) param_fields, wire_fields, params = get_serialize_params('sizeof', self)
param_names = [p[2] for p in params] param_names = [p[2] for p in params]
expr_fields_names = [f.field_name for f in get_expr_fields(field.type)] expr_fields_names = get_expr_field_names(field.type.expr)
resolved = [x for x in expr_fields_names if x in param_names] resolved = [x for x in expr_fields_names if x in param_names]
unresolved = [x for x in expr_fields_names if x not in param_names] unresolved = [x for x in expr_fields_names if x not in param_names]