private void ensureSorted ( ) { if ( sorted ) { return ; } ensureCapacity ( ) ; DataUtils . sort ( byBlockHash ) ; for ( int i = 0 ; i < size ; i ++ ) { resourceIdsIndex [ i ] = i ; } DataUtils . sort ( byResourceId ) ; sorted = true ; }
Performs sorting if necessary .