public boolean fastUnorderedRemoveInt ( final int value ) { @ DoNotSub final int index = indexOf ( value ) ; if ( - 1 != index ) { elements [ index ] = elements [ -- size ] ; return true ; } return false ; }
Remove the first instance of a value if found in the list and replaces it with the last item in the list . This saves a copy down of all items at the expense of not preserving list order .