mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
Trimmed vtables of trailing zeroes.
This is something the format supports, but none of the builders were doing. Can save 10-20% on FlatBuffer binary size! Also fixed the Go tests. Change-Id: I616c56ce9bbcfcaee23aa24f0532fcb60b6a8c75 Tested: on Linux.
This commit is contained in:
@@ -1531,9 +1531,8 @@ class CppGenerator : public BaseGenerator {
|
||||
"(const {{STRUCT_NAME}}Builder &);";
|
||||
|
||||
// Finish() function.
|
||||
auto num_fields = NumToString(struct_def.fields.vec.size());
|
||||
code_ += " flatbuffers::Offset<{{STRUCT_NAME}}> Finish() {";
|
||||
code_ += " const auto end = fbb_.EndTable(start_, " + num_fields + ");";
|
||||
code_ += " const auto end = fbb_.EndTable(start_);";
|
||||
code_ += " auto o = flatbuffers::Offset<{{STRUCT_NAME}}>(end);";
|
||||
|
||||
for (auto it = struct_def.fields.vec.begin();
|
||||
|
||||
Reference in New Issue
Block a user