use of org.eclipse.collections.impl.set.mutable.primitive.IntHashSet in project eclipse-collections by eclipse.
the class IntIntMapLargeStressTest method getJDKSequenceCollisions.
protected MutableList<Integer> getJDKSequenceCollisions(int lower, int upper) {
MutableList<Integer> jdkCollidingNumbers = FastList.newList();
int slots = KEY_COUNT / (1 << 12) + 1;
MutableIntSet indices = new IntHashSet();
for (int i = lower; i < upper && jdkCollidingNumbers.size() < KEY_COUNT; i++) {
int index = this.jdkIndex(i);
if (indices.size() < slots) {
indices.add(index);
jdkCollidingNumbers.add(i);
} else if (indices.contains(index)) {
jdkCollidingNumbers.add(i);
}
}
return jdkCollidingNumbers;
}
use of org.eclipse.collections.impl.set.mutable.primitive.IntHashSet in project eclipse-collections by eclipse.
the class IntIntMapSmallStressTest method getJDKSequenceCollisions.
protected MutableList<Integer> getJDKSequenceCollisions(int lower, int upper) {
MutableList<Integer> jdkCollidingNumbers = FastList.newList();
// slots = KEY_COUNT / (1 << 32) / (1 << MAP_SIZE) + 1;
int slots = 1;
MutableIntSet indices = new IntHashSet();
for (int i = lower; i < upper && jdkCollidingNumbers.size() < KEY_COUNT; i++) {
int index = this.jdkIndex(i);
if (indices.size() < slots) {
indices.add(index);
jdkCollidingNumbers.add(i);
} else if (indices.contains(index)) {
jdkCollidingNumbers.add(i);
}
}
return jdkCollidingNumbers;
}
Aggregations