private void pruneScrapViews(){
  final int maxViews=mActiveViews.length;
  final int viewTypeCount=mViewTypeCount;
  final ArrayList<View>[] scrapViews=mScrapViews;
  for (int i=0; i < viewTypeCount; ++i) {
    final ArrayList<View> scrapPile=scrapViews[i];
    int size=scrapPile.size();
    final int extras=size - maxViews;
    size--;
    for (int j=0; j < extras; j++) {
      removeDetachedView(scrapPile.remove(size--),false);
    }
  }
  if (mTransientStateViews != null) {
    for (int i=0; i < mTransientStateViews.size(); i++) {
      final View v=mTransientStateViews.valueAt(i);
      if (!ViewCompat.hasTransientState(v)) {
        mTransientStateViews.removeAt(i);
        i--;
      }
    }
  }
}

private void pruneScrapViews ( ) { final int maxViews = mActiveViews . length ; final int viewTypeCount = mViewTypeCount ; final ArrayList < View > [ ] scrapViews = mScrapViews ; for ( int i = 0 ; i < viewTypeCount ; ++ i ) { final ArrayList < View > scrapPile = scrapViews [ i ] ; int size = scrapPile . size ( ) ; final int extras = size - maxViews ; size -- ; for ( int j = 0 ; j < extras ; j ++ ) { removeDetachedView ( scrapPile . remove ( size -- ) , false ) ; } } if ( mTransientStateViews != null ) { for ( int i = 0 ; i < mTransientStateViews . size ( ) ; i ++ ) { final View v = mTransientStateViews . valueAt ( i ) ; if ( ! ViewCompat . hasTransientState ( v ) ) { mTransientStateViews . removeAt ( i ) ; i -- ; } } } }
makes sure that the size of mscrapviews does not exceed the size of mactiveviews . ( this can happen if an adapter does not recycle its views ) .
