Skip to content

Minor improvements #5

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Palaolitico
Copy link

Some minor changes that I think improve the code:

  • Some case analyses have been simplified.
  • Some typos using eq instead of cmp are fixed.
  • Added length 2 arrays as a base case for shuffle. Otherwise, shuffle([a,b]) will make an identical recursive call with probability 0.5. Simple benchmarking shows a 25% performance improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant