[Fix] WeightedList does not always return a value
This commit is contained in:
parent
8861c0645f
commit
c4077a42fd
1 changed files with 1 additions and 0 deletions
|
@ -93,6 +93,7 @@ public class WeightedList<T> {
|
||||||
if (weight <= weights.get(i)) {
|
if (weight <= weights.get(i)) {
|
||||||
return values.get(i);
|
return values.get(i);
|
||||||
}
|
}
|
||||||
|
weight -= weights.get(i);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue