The loop is not required as we recalculate each entry's accumulatedWeight on each call, thus there is always an entry that will be found for the random number.
It should not exist, but this is no reason to not terminate.