Skip to content

Commit ad2d1fd

Browse files
committed
no longer need _vectorize_packer
1 parent 38bcc1f commit ad2d1fd

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

python/flatbuffers/packer.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
# limitations under the License.
1414

1515
"""
16-
Provide pre-compiled struct packers for encoding and decoding, as well as
17-
a method to vectorize a pre-compiled packer.
16+
Provide pre-compiled struct packers for encoding and decoding.
1817
1918
See: https://docs.python.org/2/library/struct.html#format-characters
2019
"""
@@ -41,11 +40,3 @@
4140
uoffset = uint32
4241
soffset = int32
4342
voffset = uint16
44-
45-
def _vectorize_packer(packer, n):
46-
if packer.format[0] not in '@=<>!':
47-
raise ValueError('Flatbuffers only supports endian-safe data.')
48-
if len(packer.format) != 2:
49-
raise ValueError('Flatbuffers only supports vectors of scalar types.')
50-
fmt = packer.format[0] + str(n) + packer.format[1]
51-
return struct.Struct(fmt)

0 commit comments

Comments
 (0)