copy method
Copy a range of count
vectors beginning at srcOffset
from src
into
this list starting at offset
.
Implementation
void copy(VectorList<T> src,
{int srcOffset = 0, int offset = 0, int count = 0}) {
if (count == 0) {
count = math.min(length - offset, src.length - srcOffset);
}
final minVectorLength = math.min(_vectorLength, src._vectorLength);
for (var i = 0; i < count; i++) {
var index = _vectorIndexToBufferIndex(i + offset);
var srcIndex = src._vectorIndexToBufferIndex(i + srcOffset);
for (var j = 0; j < minVectorLength; j++) {
_buffer[index++] = src._buffer[srcIndex++];
}
}
}