reverseBuf function

List<int> reverseBuf(
  1. List<int> buf
)

Implementation

List<int> reverseBuf(List<int> buf) {
  List<int> buf2 = List.filled(buf.length, 0);
  for (var i = 0; i < buf.length; i++) {
    buf2[i] = buf[buf.length - 1 - i];
  }
  return buf2;
}