private void copy ( ) { if ( elems . nonEmpty ( ) ) { List < A > orig = elems ; elems = last = List . of ( orig . head ) ; while ( ( orig = orig . tail ) . nonEmpty ( ) ) { last . tail = List . of ( orig . head ) ; last = last . tail ; } } }
Copy list and sets last .