[Dart] Fix prepare space for writeListInt64 and writeListUint64 (#5654)

* Fix prepare space for writeListInt64 and 

writeListUint64

* Fix align issues
This commit is contained in:
Light Lin 2019-12-19 03:23:54 +08:00 committed by Wouter van Oortmerssen
parent aa75e5734b
commit ce3a1c43a2
1 changed files with 3 additions and 3 deletions

View File

@ -492,7 +492,7 @@ class Builder {
/// Write the given list of 64-bit float [values].
int writeListFloat64(List<double> values) {
_ensureNoVTable();
_prepare(4, 1 + (2 * values.length));
_prepare(_sizeofFloat64, values.length, additionalBytes: _sizeofUint32);
final int result = _tail;
int tail = _tail;
_setUint32AtTail(_buf, tail, values.length);
@ -522,7 +522,7 @@ class Builder {
/// Write the given list of signed 64-bit integer [values].
int writeListInt64(List<int> values) {
_ensureNoVTable();
_prepare(_sizeofUint32, 2 * values.length);
_prepare(_sizeofInt64, values.length, additionalBytes: _sizeofUint32);
final int result = _tail;
int tail = _tail;
_setUint32AtTail(_buf, tail, values.length);
@ -537,7 +537,7 @@ class Builder {
/// Write the given list of signed 64-bit integer [values].
int writeListUint64(List<int> values) {
_ensureNoVTable();
_prepare(_sizeofUint32, 2 * values.length);
_prepare(_sizeofUint64, values.length, additionalBytes: _sizeofUint32);
final int result = _tail;
int tail = _tail;
_setUint32AtTail(_buf, tail, values.length);