baseSlice function
Implementation
List baseSlice(List array, int start, int end) {
int index = -1, length = array.length;
if (start < 0) {
start = -start > length ? 0 : (length + start);
}
end = end > length ? length : end;
if (end < 0) {
end += length;
}
length = start > end ? 0 : ((end - start).toUnsigned(32));
start = start.toUnsigned(32);
List result = [];
while (++index < length) {
result.add(array[index + start]);
}
return result;
}