From 068af21cb376eb824fa1dee29a6539feadb93587 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Fri, 30 Jul 2021 22:58:45 +0300 Subject: [PATCH] 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 --- src/c_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/c_client.py b/src/c_client.py index b987f4e..26e2ff7 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -977,7 +977,7 @@ def _c_serialize_helper_list_field(context, self, field, param_fields, wire_fields, params = get_serialize_params('sizeof', self) 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] unresolved = [x for x in expr_fields_names if x not in param_names]