Remove unneeded empty check from WeightedRandom

This commit is contained in:
Jason Penilla committed 2022-10-07 16:20:26 -07:00
1 parent 95bf4efcf2
commit b087e1fcd5
1 file changed
-3
@@ -23,9 +23,6 @@ public class WeightedRandom<E> {
}
public E next(final Random random) {
if (this.map.isEmpty()) {
throw new IllegalStateException("No elements to select from");
}
return this.map.higherEntry(random.nextDouble() * this.total).getValue();
}