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

MutableQHashSeparateKVLongObjMap rehash BUG #71

Open
tuhuiming opened this issue May 18, 2020 · 0 comments
Open

MutableQHashSeparateKVLongObjMap rehash BUG #71

tuhuiming opened this issue May 18, 2020 · 0 comments

Comments

@tuhuiming
Copy link

public static void rehashTest() {
// RuntimeType:MutableQHashSeparateKVLongObjMap
HashLongObjMap newMutableMap = HashLongObjMaps.getDefaultFactory()
.withHashConfig(HashConfig.fromLoads(0.80, 0.89, 0.97).withGrowthFactor(1.15))
.newMutableMap();
newMutableMap.put(3, 3);
newMutableMap.put(6, 6);
newMutableMap.put(2, 2);
newMutableMap.put(8, 8);
newMutableMap.put(4, 4);
newMutableMap.put(5, 5);
newMutableMap.put(1, 1);
System.out.println(newMutableMap.size()); // 7
System.out.println(newMutableMap); // {5=5, 6=6, 2=2, 1=1, 3=3, 8=8, 4=4}
newMutableMap.remove(3);
newMutableMap.remove(4);
newMutableMap.remove(5);
System.out.println(newMutableMap.shrink());### // TODO will trigger rehash and reset "removedSlots" flag, cause copy arrays error!
System.out.println(newMutableMap.size()); // 4
System.out.println(newMutableMap); // {8=8, 2=2, 269536850670147407=null, 269536850670147407=null, 6=6, 269536850670147407=null, 1=1}
}

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