summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRichard A Hofer <rofer@google.com>2020-12-14 15:00:28 -0500
committerGitHub <noreply@github.com>2020-12-14 12:00:28 -0800
commitf8b203c9c4bec53cb9abceef6bc333a02f272b6b (patch)
treee31a0b93d9b682574dac49652b75c193c8070ea5 /docs
parent8ab7c7e2c82c168e6ce019f7b538350e3a1528dc (diff)
downloadflatbuffers-f8b203c9c4bec53cb9abceef6bc333a02f272b6b.tar.gz
flatbuffers-f8b203c9c4bec53cb9abceef6bc333a02f272b6b.tar.bz2
flatbuffers-f8b203c9c4bec53cb9abceef6bc333a02f272b6b.zip
Add vectorNumElements attribute to Builder for simpler vector creation. (#6328)
* Add vectorNumElements attribute to Builder for simpler vector creation. This adds a default to EndVector which should simplify its use. * Update tutorial to reflect new default arg in Python EndVector. * Remove optional argument to Python EndVector. * Add generated files. * Unset Builder.vectorNumElems when not in use.
Diffstat (limited to 'docs')
-rw-r--r--docs/source/Tutorial.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/source/Tutorial.md b/docs/source/Tutorial.md
index 419ea09d..f3f03f55 100644
--- a/docs/source/Tutorial.md
+++ b/docs/source/Tutorial.md
@@ -1017,7 +1017,7 @@ traversal. This is generally easy to do on any tree structures.
MyGame.Sample.Monster.MonsterStartInventoryVector(builder, 10)
for i in reversed(range(0, 10)):
builder.PrependByte(i)
- inv = builder.EndVector(10)
+ inv = builder.EndVector()
~~~
</div>
<div class="language-javascript">
@@ -1207,7 +1207,7 @@ offsets.
MyGame.Sample.Monster.MonsterStartWeaponsVector(builder, 2)
builder.PrependUOffsetTRelative(axe)
builder.PrependUOffsetTRelative(sword)
- weapons = builder.EndVector(2)
+ weapons = builder.EndVector()
~~~
</div>
<div class="language-javascript">
@@ -1336,7 +1336,7 @@ for the `path` field above:
MyGame.Sample.Monster.MonsterStartPathVector(builder, 2)
MyGame.Sample.Vec3.CreateVec3(builder, 1.0, 2.0, 3.0)
MyGame.Sample.Vec3.CreateVec3(builder, 4.0, 5.0, 6.0)
- path = builder.EndVector(2)
+ path = builder.EndVector()
~~~
</div>
<div class="language-javascript">