addAllStartingAt_Unsafe method
void
addAllStartingAt_Unsafe(])
override
Internal implementation of addAllStartingAt, which does not do any safety checks regarding sorting. Only to be overridden in children.
Implementation
@override
// ignore: non_constant_identifier_names
void addAllStartingAt_Unsafe(Iterable<T> source,
[int skipItems = 0, int? nrItems]) {
// Try the fast algorithm if the data is of the correct type.
if (runtimeType == source.runtimeType) {
_addAllStartingAtFast_Unsafe(
source as GpcEfficient<T>, skipItems, nrItems);
} else {
// No the same type -> do a slow copy.
// For regular iterables, calling length will consume it, so we don't
// want to do it. But for RandomAccessIterable, it's a safe operation and
// we can use it to preset the capacity for performance reasons.
if (source is RandomAccessIterable) {
capacity = _elementsCount + (nrItems ?? (source.length - skipItems));
}
for (var element in getSubSource(source, skipItems, nrItems)) {
add_Unsafe(element);
}
}
}