sortedArray static method

dynamic sortedArray(
  1. List<num> values,
  2. dynamic stride,
  3. dynamic order
)

Implementation

static sortedArray(List<num> values, stride, order) {
  var nValues = values.length;
  var result = List<num>.filled(nValues, 0);

  for (var i = 0, dstOffset = 0; dstOffset != nValues; ++i) {
    var srcOffset = order[i] * stride;

    for (var j = 0; j != stride; ++j) {
      result[dstOffset++] = values[srcOffset + j];
    }
  }

  return result;
}