Remove useless length check
This commit is contained in:
parent
e1790ff7a5
commit
52b91cae87
@ -23,11 +23,6 @@ export class WeightedRandomHelper
|
|||||||
const itemKeys = Object.keys(itemArray);
|
const itemKeys = Object.keys(itemArray);
|
||||||
const weights = Object.values(itemArray);
|
const weights = Object.values(itemArray);
|
||||||
|
|
||||||
if (itemKeys.length !== weights.length)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const chosenItem = this.weightedRandom(itemKeys, weights);
|
const chosenItem = this.weightedRandom(itemKeys, weights);
|
||||||
|
|
||||||
return chosenItem.item;
|
return chosenItem.item;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user