private void pruneMatches ( ) { int index = 0 ; while ( index < matches . size ) { AssociatedTripleIndex a = matches . get ( index ) ; // not matched. Remove it from the list by copying that last element over it if ( a . c == - 1 ) { a . set ( matches . get ( matches . size - 1 ) ) ; matches . size -- ; } else { index ++ ; } } }
Removes by swapping all elements with a c index of - 1