Compaction.
This commit is contained in:
@@ -185,11 +185,7 @@ public class Randoms
|
|||||||
public <T> T pick (T[] array, T ifEmpty)
|
public <T> T pick (T[] array, T ifEmpty)
|
||||||
{
|
{
|
||||||
int size = array.length;
|
int size = array.length;
|
||||||
if (size == 0) {
|
return (size == 0) ? ifEmpty : array[_r.nextInt(size)];
|
||||||
return ifEmpty;
|
|
||||||
}
|
|
||||||
|
|
||||||
return array[_r.nextInt(size)];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user