copyFrom method Null safety

void copyFrom(
  1. Model15<ProgramOperation> m,
  2. Matrix other
)

Implementation

void copyFrom(Model15 m, Matrix other) {
  if (other == this) {
    return;
  }
  resize(m, other.rows, other.columns);
  for (int i = 0; i < length; i++) {
    _values[i] = other._values[i];
  }
  final ors = other._rowSwaps;
  if (ors == null) {
    _rowSwaps = null;
  } else {
    _rowSwaps = List.generate(ors.length, (i) => ors[i], growable: false);
  }
  m.needsSave = true;
}