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

Make DList.partition work with nonepure funcs #264

Merged
merged 1 commit into from
May 29, 2013

Conversation

espringe
Copy link
Contributor

DList.partition should only call the function once per element in the DList. This is very important for predicting performance (e.g. the function is super duper expensive) and even more importantly, when using a non-pure function. For instance, if you used partition to split your data into two parts based on a random number generator -- with the current code, you would have duplicates (and missing elements) in the final results. This is extremely unexpected.

This unit test fails (for which, I'll create a bug), but the pull request introduces no regressions per se so I think its safe to pull.

@espringe espringe mentioned this pull request May 29, 2013
@etorreborre etorreborre merged commit 1baa4ed into master May 29, 2013
@etorreborre etorreborre deleted the experimental-partition branch May 29, 2013 22:49
@etorreborre etorreborre self-assigned this Mar 3, 2014
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