From b76ab3cdac8374572c50579ecf3e818dad39acb9 Mon Sep 17 00:00:00 2001 From: David Hoover Date: Tue, 23 Aug 2011 13:33:11 -0700 Subject: [PATCH] No longer pick from arrays. Per the wailing and gnashing of teeth in response to 7e51d4c and 7bb7ee2, I'll do the extra legwork to keep my bits in a List despite java handing them to me as an array. --- src/main/java/com/samskivert/util/Randoms.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/main/java/com/samskivert/util/Randoms.java b/src/main/java/com/samskivert/util/Randoms.java index 74e5f323..4a6e7998 100644 --- a/src/main/java/com/samskivert/util/Randoms.java +++ b/src/main/java/com/samskivert/util/Randoms.java @@ -176,18 +176,6 @@ public class Randoms return pickPluck(iterable, ifEmpty, false); } - /** - * Pick a random element from the specified array, or return ifEmpty - * if it is empty. - * - * @throws NullPointerException if the array is null. - */ - public T pick (T[] array, T ifEmpty) - { - int size = array.length; - return (size == 0) ? ifEmpty : array[_r.nextInt(size)]; - } - /** * Pick a random key from the specified mapping of weight values, or return * ifEmpty if no mapping has a weight greater than 0. Each