truncate method

void truncate(
  1. int newLen
)

Shortens the vector, keeping the first len elements and dropping the rest.

Implementation

@pragma('vm:prefer-inline')
void truncate(int newLen) => length = newLen;