private void smartAppend ( short [ ] vl , short val ) { int oldend ; if ( ( nbrruns == 0 ) || ( toIntUnsigned ( val ) > ( oldend = toIntUnsigned ( vl [ 2 * ( nbrruns - 1 ) ] ) + toIntUnsigned ( vl [ 2 * ( nbrruns - 1 ) + 1 ] ) ) + 1 ) ) { // we add a new one vl [ 2 * nbrruns ] = val ; vl [ 2 * nbrruns + 1 ] = 0 ; nbrruns ++ ; return ; } if ( val == ( short ) ( oldend + 1 ) ) { // we merge vl [ 2 * ( nbrruns - 1 ) + 1 ] ++ ; } }
to return ArrayContainer or BitmapContainer