Protobuf: removed named arguments in constructors and redundant init section from generated code

This commit is contained in:
dsavvinov
2016-08-11 13:47:07 +03:00
parent 32c26414d4
commit cea504b095
2 changed files with 2 additions and 6 deletions
@@ -32,10 +32,6 @@ void ClassGenerator::generateCode(io::Printer *printer, bool isBuilder) const {
// Generate field for errors code
printer->Print("var errorCode: Int = 0\n\n");
// Generate construction routines
generateInitSection(printer);
printer->Print("\n");
// enum declarations and nested classes declarations only for fair classes
if (!isBuilder) {
if (enumsDeclaraions.size() > 0) {
@@ -422,7 +418,7 @@ string ClassGenerator::getBuilderInitValue() const {
// build list of arguments like 'field1: Type1, field2: Type2, ... '
string argumentList = "";
for (int i = 0; i < properties.size(); ++i) {
argumentList += properties[i]->simpleName + " = " + properties[i]->getInitValue();
argumentList += properties[i]->getInitValue();
if (i + 1 != properties.size()) {
argumentList += ", ";
}
@@ -25,7 +25,7 @@ string FieldGenerator::getInitValue() const {
// build list of arguments like 'field1: Type1, field2: Type2, ... '
string argumentList = "";
for (int i = 0; i < cg->properties.size(); ++i) {
argumentList += cg->properties[i]->simpleName + " = " + cg->properties[i]->getInitValue();
argumentList += cg->properties[i]->getInitValue();
if (i + 1 != cg->properties.size()) {
argumentList += ", ";
}