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 comment typo in ConcurrentHashMap #2990

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ Node<K,V> find(int h, Object k) {
static final int spread(int h) {
// EHCACHE SPECIFIC
// We modify the hash spread to help eviction sampling. Because, in a full hashmap, ordered numbers will be hashed as [ 1, 2, 3, e, e, e ] ('e' being empty)
// So everything is at the beginning of the map. Then, is the sampler starts randomly at index 2, it will find empty nodes all the
// So everything is at the beginning of the map. Then, if the sampler starts randomly at index 2, it will find empty nodes all the
// way to the end and will then wrap at the beginning. Slow. To prevent that, we perform a rotate left which basically multiplies everything
// by two but also wraps the last bit. The spreading will then be [ 1, e, 2, e, 3, e ] which will be much nicer for sampling and only be a tiny tiny
// bit slower at access.
Expand Down