Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Random.GetItems observably breaking change in produced sequence (#…
…108018) Developers, often in tests, rely on seeded Random instances producing the same sequence of values on every use. We made a change in .NET 9, though, that changed the sequence GetItems produces, due to employing a different algorithm. This fixes that special-case to only be used when the developer couldn't rely on the results being deterministic, namely when using either `new Random()` or `Random.Shared`. If a seed is provided or if a custom derived implementation is used, it falls back to the old behavior. Co-authored-by: Stephen Toub <stoub@microsoft.com>
- Loading branch information