private void pruneExcessiveHistoricalRecordsIfNeeded ( ) { final int pruneCount = mHistoricalRecords . size ( ) - mHistoryMaxSize ; if ( pruneCount <= 0 ) { return ; } mHistoricalRecordsChanged = true ; for ( int i = 0 ; i < pruneCount ; i ++ ) { HistoricalRecord prunedRecord = mHistoricalRecords . remove ( 0 ) ; if ( DEBUG ) { Log . i ( LOG_TAG , "Pruned: " + prunedRecord ) ; } } }
Prunes older excessive records to guarantee maxHistorySize .