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

fix: refactored arrayElement and added separate iterator overloads for optimization #840

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

eric-bodhi
Copy link
Contributor

refactored arrayElement to randomElement and weightedArrayElement to weightedRandomElement, and sortedSizeArrayElement to sortedSizeRandomElement

Added optimizations to randomElement to support all types of iterators, optimized overloads for random_access, forward_iterator, and input_iterator.

@eric-bodhi
Copy link
Contributor Author

If you'd like me to add some inline documentation since this code is kinda hard to read I can

@cieslarmichal cieslarmichal merged commit 18a9313 into cieslarmichal:main Aug 2, 2024
15 checks passed
@eric-bodhi eric-bodhi deleted the bugfix branch August 3, 2024 21:17
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.

2 participants