csharp: Simplify field_argument_assignment

Summary: Avoid extra generator calls.

Reviewers: jptiz

Reviewed By: jptiz

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10774
This commit is contained in:
Lauro Moura 2019-12-02 16:23:29 -03:00
parent 6b04e5f215
commit dfae8c5185
1 changed files with 3 additions and 2 deletions

View File

@ -45,8 +45,9 @@ struct field_argument_assignment_generator
template<typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
{
if (!as_generator("this." << string << " = " << string)
.generate(sink, std::make_tuple(name_helpers::to_field_name(field.name), name_helpers::to_field_name(field.name)), context))
auto field_name = name_helpers::to_field_name(field.name);
if (!as_generator("this." << field_name << " = " << field_name)
.generate(sink, attributes::unused, context))
return false;
return true;
}