avoid AIOOBE

This commit is contained in:
Zlatin Balevsky
2019-07-06 11:00:31 +01:00
parent b6c9ccb7f6
commit db36367b11

View File

@@ -43,7 +43,7 @@ class Pieces {
for (int i = claimed.nextSetBit(0); i >= 0; i = claimed.nextSetBit(i+1))
available.remove(i)
if (available.isEmpty())
return -1
return null
List<Integer> toList = available.toList()
Collections.shuffle(toList)
int rv = toList[0]