Skip to content
Snippets Groups Projects
Commit be2f307d authored by Kristof Szabados's avatar Kristof Szabados
Browse files

some optimalizations.


Signed-off-by: default avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent 09161ea8
No related branches found
No related tags found
No related merge requests found
...@@ -3871,7 +3871,8 @@ void defRecordClass1(const struct_def *sdef, output_struct *output) ...@@ -3871,7 +3871,8 @@ void defRecordClass1(const struct_def *sdef, output_struct *output)
} }
src = mputprintf(src, src = mputprintf(src,
" for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {\n" " 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" " break;\n"
" }\n" " }\n"
" } break;\n" " } break;\n"
...@@ -6410,7 +6411,8 @@ void defRecordTemplate1(const struct_def *sdef, output_struct *output) ...@@ -6410,7 +6411,8 @@ void defRecordTemplate1(const struct_def *sdef, output_struct *output)
} }
src = mputprintf(src, src = mputprintf(src,
" for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {\n" " 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" " break;\n"
" }\n" " }\n"
" } break;\n" " } break;\n"
......
...@@ -4564,8 +4564,9 @@ void defRecordOfTemplate1(const struct_of_def *sdef, output_struct *output) ...@@ -4564,8 +4564,9 @@ void defRecordOfTemplate1(const struct_of_def *sdef, output_struct *output)
" break;\n" " break;\n"
" case Module_Param::MP_Permutation_Template: {\n" " case Module_Param::MP_Permutation_Template: {\n"
" int perm_start_idx = curr_idx;\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" " Module_Param* param_i = param.get_elem(p_i);\n"
" (*this)[curr_idx].set_param(*(param.get_elem(p_i)->get_elem(perm_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" " curr_idx++;\n"
" }\n" " }\n"
" int perm_end_idx = curr_idx - 1;\n" " int perm_end_idx = curr_idx - 1;\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment