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

Optimization: when creating empty map, return common instance #60

Open
object88 opened this issue Jan 25, 2017 · 1 comment
Open

Optimization: when creating empty map, return common instance #60

object88 opened this issue Jan 25, 2017 · 1 comment

Comments

@object88
Copy link
Owner

In order to prevent repeatedly creating Hashmaps with no contents, when a new hashmap is requested, if there are no contents, return a static instance.

This is what immutable.js does.

This may effect some unit tests.

@object88
Copy link
Owner Author

Also, if last key-value-pair is removed from hashmap, return default hashmap, not new instance.

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

No branches or pull requests

1 participant