mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-03 19:24:12 +00:00
Fix a typo in Swift codegen (#6470)
* Fix a typo in Swift codegen * Fix code formatting.
This commit is contained in:
@@ -590,8 +590,9 @@ class SwiftGenerator : public BaseGenerator {
|
|||||||
|
|
||||||
if (IsStruct(field.value.type)) {
|
if (IsStruct(field.value.type)) {
|
||||||
auto create_struct =
|
auto create_struct =
|
||||||
"guard let pos = pos else { return };"
|
"guard let {{VALUENAME}} = {{VALUENAME}} else { return };"
|
||||||
" fbb.create(struct: pos, position: {{TABLEOFFSET}}.{{OFFSET}}.p) }";
|
" fbb.create(struct: {{VALUENAME}}, position: "
|
||||||
|
"{{TABLEOFFSET}}.{{OFFSET}}.p) }";
|
||||||
code_ += type + "?" + builder_string + create_struct;
|
code_ += type + "?" + builder_string + create_struct;
|
||||||
/// Optional hard coded since structs are always optional
|
/// Optional hard coded since structs are always optional
|
||||||
create_func_header.push_back(name + ": " + type + "? = nil");
|
create_func_header.push_back(name + ": " + type + "? = nil");
|
||||||
|
|||||||
Reference in New Issue
Block a user