Commit be2f307d authored by Kristof Szabados's avatar Kristof Szabados
Browse files

some optimalizations.


Signed-off-by: Kristof Szabados's avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent 09161ea8
......@@ -3871,7 +3871,8 @@ void defRecordClass1(const struct_def *sdef, output_struct *output)
}
src = mputprintf(src,
" for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {\n"
" param.get_elem(val_idx)->error(\"Non existent field name in type %s: %%s\", param.get_elem(val_idx)->get_id()->get_name());\n"
" Module_Param* const curr_param = param.get_elem(val_idx);\n"
" curr_param->error(\"Non existent field name in type %s: %%s\", curr_param->get_id()->get_name());\n"
" break;\n"
" }\n"
" } break;\n"
......@@ -6410,7 +6411,8 @@ void defRecordTemplate1(const struct_def *sdef, output_struct *output)
}
src = mputprintf(src,
" for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {\n"
" param.get_elem(val_idx)->error(\"Non existent field name in type %s: %%s\", param.get_elem(val_idx)->get_id()->get_name());\n"
" Module_Param* const curr_param = param.get_elem(val_idx);\n"
" curr_param->error(\"Non existent field name in type %s: %%s\", curr_param->get_id()->get_name());\n"
" break;\n"
" }\n"
" } break;\n"
......
......@@ -4564,8 +4564,9 @@ void defRecordOfTemplate1(const struct_of_def *sdef, output_struct *output)
" break;\n"
" case Module_Param::MP_Permutation_Template: {\n"
" int perm_start_idx = curr_idx;\n"
" for (size_t perm_i=0; perm_i<param.get_elem(p_i)->get_size(); perm_i++) {\n"
" (*this)[curr_idx].set_param(*(param.get_elem(p_i)->get_elem(perm_i)));\n"
" Module_Param* param_i = param.get_elem(p_i);\n"
" for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {\n"
" (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));\n"
" curr_idx++;\n"
" }\n"
" int perm_end_idx = curr_idx - 1;\n"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment