mirror of
https://github.com/vee1e/flatbuffers.git
synced 2026-09-03 02:37:31 +00:00
applied struct parameter fix to Go and Python generated classes
This commit is contained in:
parent
147fbb4285
commit
c23c620d26
5 changed files with 12 additions and 12 deletions
|
|
@ -307,9 +307,9 @@ static void StructBuilderArgs(const StructDef &struct_def,
|
|||
if (IsStruct(field.value.type)) {
|
||||
// Generate arguments for a struct inside a struct. To ensure names
|
||||
// don't clash, and to make it obvious these arguments are constructing
|
||||
// a nested struct, prefix the name with the struct name.
|
||||
// a nested struct, prefix the name with the field name.
|
||||
StructBuilderArgs(*field.value.type.struct_def,
|
||||
(field.value.type.struct_def->name + "_").c_str(),
|
||||
(nameprefix + (field.name + "_")).c_str(),
|
||||
code_ptr);
|
||||
} else {
|
||||
std::string &code = *code_ptr;
|
||||
|
|
@ -341,7 +341,7 @@ static void StructBuilderBody(const StructDef &struct_def,
|
|||
code += " builder.Pad(" + NumToString(field.padding) + ")\n";
|
||||
if (IsStruct(field.value.type)) {
|
||||
StructBuilderBody(*field.value.type.struct_def,
|
||||
(field.value.type.struct_def->name + "_").c_str(),
|
||||
(nameprefix + (field.name + "_")).c_str(),
|
||||
code_ptr);
|
||||
} else {
|
||||
code += " builder.Prepend" + GenMethod(field) + "(";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue