Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A customer could buy a product more than one time, which generated two identical entries in the `products_available_to_rate` collection. When it was a vec and the rng-generated number of reviews was requested such that all the unique reviewable products were reviewed, the previous code would sit in an infinite loop due to the number of ratings being less than the number of available products to rate. By changing the collection to a HashSet, we have to update the code that searched for an entry, but we fix the underlying issue of trying to generate too many reviews. We also make the performance of the faking a bit more predictable, since the generated random number can't "miss" anymore. The next available entry will be used.
- Loading branch information