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:
Wouter van Oortmerssen
2017-08-21 13:44:23 -07:00
parent 513958ea72
commit ac1015e3c4
25 changed files with 129 additions and 62 deletions

View File

@@ -196,7 +196,7 @@ struct AttackerBuilder {
}
AttackerBuilder &operator=(const AttackerBuilder &);
flatbuffers::Offset<Attacker> Finish() {
const auto end = fbb_.EndTable(start_, 1);
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<Attacker>(end);
return o;
}
@@ -309,7 +309,7 @@ struct MovieBuilder {
}
MovieBuilder &operator=(const MovieBuilder &);
flatbuffers::Offset<Movie> Finish() {
const auto end = fbb_.EndTable(start_, 4);
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<Movie>(end);
return o;
}