slc static method

List<int> slc(
  1. dynamic v, [
  2. int? s,
  3. int? e
])

Implementation

static List<int> slc (v, [int? s, int? e]) {
  if (s == null || s < 0){
    s = 0;
  }
  if (e == null || e > v.length){
    e = v.length;
  }
  // can't use .constructor in case user-supplied
  List<int> n = (v is Uint16List ? Uint16List(e! - s) : v is Uint32List ? Uint32List(e! - s) : Uint8List(e! - s));
  n.set(v.sublist(s, e));
  return n;
}