Skip to content

Factor out "OrderMapCore" and other generics bloat saving measures #59

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

Merged
merged 8 commits into from
Jan 27, 2018

Conversation

bluss
Copy link
Member

@bluss bluss commented Jan 27, 2018

For each compiled item we ideally want it to depend on the least amount of type parameters, so that it can be shared between different parameterizations of OrderMap. To this end, factor out the part of ordermap that does not depend on S (the hasher). This also seems like a cleaner design, even if it needs some more wrapper methods.

As a bonus, this resolves the issue where we had one more parameter than the standard HashMap's Entry<K, V> -- ordermap's entry is now identical.

Also reduce the number of closures used in the iterators.

bluss added 4 commits January 27, 2018 20:37
To reduce generics bloat, factor out a whole lot of the code that does
not depend on the type parameter S (the hasher). This also means we get
an `Entry<K, V>` without S which matches the standard `HashMap`.
@bluss bluss mentioned this pull request Jan 27, 2018
21 tasks
bluss added 4 commits January 27, 2018 21:07
The closures are used once per iterator method this way, and we don't
want that duplication. Use accessors on the Bucket struct instead. This
saves several trans items (if several methods on an iterator are used).
@bluss bluss merged commit 6ed63ba into master Jan 27, 2018
@bluss bluss deleted the core-refactor branch January 27, 2018 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant