That's already a T, so we don't need to cast it.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2908 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
karma@deadmoose.com
2010-10-01 22:44:46 +00:00
parent bf9fd231e0
commit 12906728e5
@@ -223,7 +223,6 @@ public class Randoms
/**
* Shared code for pick and pluck.
*/
@SuppressWarnings("unchecked")
protected <T> T pickPluck (Iterable<? extends T> iterable, T ifEmpty, boolean remove)
{
if (iterable instanceof Collection) {
@@ -237,7 +236,7 @@ public class Randoms
// extra-special optimized path for Lists
List<? extends T> list = (List<? extends T>)coll;
int idx = _r.nextInt(size);
return (T)(remove ? list.remove(idx) : list.get(idx));
return remove ? list.remove(idx) : list.get(idx);
}
// for other Collections, we must iterate
Iterator<? extends T> it = coll.iterator();