BucketListの些細な改良

This commit is contained in:
tateisu 2017-05-10 09:55:58 +09:00
parent 124a9520fd
commit 5343c6e44c
1 changed files with 8 additions and 0 deletions

View File

@ -150,14 +150,22 @@ public class BucketList < E >
bucket.addAll( c );
groups.add( pos.group_index, bucket );
}
updateIndex();
return true;
}
public E remove( int index ){
BucketPos pos = findPos( pos_internal.get(), index );
Bucket< E > bucket = groups.get( pos.group_index );
E data = bucket.remove( pos.bucket_index );
if( bucket.isEmpty() ){
groups.remove( pos.group_index );
}
updateIndex();
return data;
}