private void insertPending() {
        for (Pair<Integer, T> pi : mPendingItemsToInsert) {
            for (AtomicInteger existing : mActiveIndexes) {
                if (existing.intValue() >= pi.first) {
                    existing.incrementAndGet();
                }
            }
            mActiveIndexes.add(new AtomicInteger(pi.first));
            mInsertable.add(pi.first, pi.second);
        }
        mPendingItemsToInsert.clear();
    }
private void insertPending() {
        for (Pair<Integer, T> pi : mPendingItemsToInsert) {
            for (AtomicInteger existing : mActiveIndexes) {
                if (existing.intValue() >= pi.first) {
                    existing.incrementAndGet();
                }
            }
            mActiveIndexes.add(new AtomicInteger(pi.first));
            mInsertable.add(pi.first, pi.second);
        }
        mPendingItemsToInsert.clear();
    }
private void insertPending ( ) { for ( Pair < Integer , T > pi : mPendingItemsToInsert ) { for ( AtomicInteger existing : mActiveIndexes ) { if ( existing . intValue ( ) >= pi . first ) { existing . incrementAndGet ( ) ; } } mActiveIndexes . add ( new AtomicInteger ( pi . first ) ) ; mInsertable . add ( pi . first , pi . second ) ; } mPendingItemsToInsert . clear ( ) ; }
Inserts pending items into the Insertable, and adds them to the active positions (correctly managing position shifting). Clears the pending items.
Inserts pending items into the Insertable and adds them to the active positions ( correctly managing position shifting ) . Clears the pending items .