Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow random permutations without restrictions #266

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

boesing
Copy link
Owner

@boesing boesing commented Aug 22, 2024

In the initial PR, I prevented shuffle from returning the same value as the initial value. Since this might not be the expected outcome, I removed this behavior. Especially as that would prevent use-cases in real-world projects which want to use the shuffle method to i.e. load balance between multiple hostnames as the configured order would never be a result after using shuffle which basically prevents a specific order from being used at any time.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@boesing boesing added the enhancement New feature or request label Aug 22, 2024
@boesing boesing added this to the 2.0.0 milestone Aug 22, 2024
Somehow, psalm does not properly infer the returned `OrderedListInterface<TValue>` generic and thus is not happy with this comparison. I guess this is a bug but I do not want to hassle with it right now.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@boesing boesing merged commit 1e3e8b7 into 2.0.x Aug 22, 2024
11 checks passed
@boesing boesing deleted the qa/shuffle-fisher-yates branch August 22, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant