mirror of
https://github.com/corda/corda.git
synced 2025-01-18 10:46:38 +00:00
client: Address PR 290 comments
This commit is contained in:
parent
1e78d6a3a7
commit
f4f83325a7
@ -178,9 +178,10 @@ fun <A : Any> Generator.Companion.pickN(number: Int, list: List<A>) = Generator<
|
||||
val mask = BitSet(list.size)
|
||||
val size = Math.min(list.size, number)
|
||||
for (i in 0..size - 1) {
|
||||
// mask[i] = 1 desugars into mask.set(i, 1), which sets a range instead of a bit
|
||||
mask[i] = true
|
||||
}
|
||||
for (i in 0..size - 1) {
|
||||
for (i in 0..list.size - 1) {
|
||||
val bit = mask[i]
|
||||
val swapIndex = i + it.nextInt(size - i)
|
||||
mask[i] = mask[swapIndex]
|
||||
|
Loading…
Reference in New Issue
Block a user