Use IndexError.check instead of RangeError.checkValidIndex in buffers. (flutter/engine#37450)

This commit is contained in:
Kallen Tu
2022-11-09 10:30:21 -08:00
committed by GitHub
parent 32be4b0970
commit 1da0e076d4

View File

@@ -108,7 +108,7 @@ abstract class _TypedDataBuffer<E> extends ListBase<E> {
/// or equal to [start] and [values] must have at least [end] elements.
@override
void insertAll(int index, Iterable<E> values, [int start = 0, int? end]) {
RangeError.checkValidIndex(index, this, 'index', _length + 1);
IndexError.check(index, _length + 1, indexable: this, name: 'index');
RangeError.checkNotNegative(start, 'start');
if (end != null) {
if (start > end) {