private int insertNewKey(int key) { if (check && occupiedCount != keyCount) Kit.codeBug(); if (check && keyCount == 1 << power) Kit.codeBug(); int[] keys = this.keys; int fraction = key * A; int index = fraction >>> (32 - power); if (keys[index] != EMPTY) { int mask = (1 << power) - 1; int step = tableLookupStep(fraction, mask, power); int firstIndex = index; do { if (check && keys[index] == DELETED) Kit.codeBug(); index = (index + step) & mask; if (check && firstIndex == index) Kit.codeBug(); } while (keys[index] != EMPTY); } keys[index] = key; ++occupiedCount; ++keyCount; return index; }
private int insertNewKey(int key) { if (check && occupiedCount != keyCount) Kit.codeBug(); if (check && keyCount == 1 << power) Kit.codeBug(); int[] keys = this.keys; int fraction = key * A; int index = fraction >>> (32 - power); if (keys[index] != EMPTY) { int mask = (1 << power) - 1; int step = tableLookupStep(fraction, mask, power); int firstIndex = index; do { if (check && keys[index] == DELETED) Kit.codeBug(); index = (index + step) & mask; if (check && firstIndex == index) Kit.codeBug(); } while (keys[index] != EMPTY); } keys[index] = key; ++occupiedCount; ++keyCount; return index; }
private int insertNewKey(int key) { if (check && occupiedCount != keyCount) Kit.codeBug(); if (check && keyCount == 1 << power) Kit.codeBug(); int[] keys = this.keys; int fraction = key * A; int index = fraction >>> (32 - power); if (keys[index] != EMPTY) { int mask = (1 << power) - 1; int step = tableLookupStep(fraction, mask, power); int firstIndex = index; do { if (check && keys[index] == DELETED) Kit.codeBug(); index = (index + step) & mask; if (check && firstIndex == index) Kit.codeBug(); } while (keys[index] != EMPTY); } keys[index] = key; ++occupiedCount; ++keyCount; return index; }
private int insertNewKey(int key) { if (check && occupiedCount != keyCount) Kit.codeBug(); if (check && keyCount == 1 << power) Kit.codeBug(); int[] keys = this.keys; int fraction = key * A; int index = fraction >>> (32 - power); if (keys[index] != EMPTY) { int mask = (1 << power) - 1; int step = tableLookupStep(fraction, mask, power); int firstIndex = index; do { if (check && keys[index] == DELETED) Kit.codeBug(); index = (index + step) & mask; if (check && firstIndex == index) Kit.codeBug(); } while (keys[index] != EMPTY); } keys[index] = key; ++occupiedCount; ++keyCount; return index; }
private int insertNewKey(int key) { if (check && occupiedCount != keyCount) Kit.codeBug(); if (check && keyCount == 1 << power) Kit.codeBug(); int[] keys = this.keys; int fraction = key * A; int index = fraction >>> (32 - power); if (keys[index] != EMPTY) { int mask = (1 << power) - 1; int step = tableLookupStep(fraction, mask, power); int firstIndex = index; do { if (check && keys[index] == DELETED) Kit.codeBug(); index = (index + step) & mask; if (check && firstIndex == index) Kit.codeBug(); } while (keys[index] != EMPTY); } keys[index] = key; ++occupiedCount; ++keyCount; return index; }
private int insertNewKey(int key) { if (check && occupiedCount != keyCount) Kit.codeBug(); if (check && keyCount == 1 << power) Kit.codeBug(); int[] keys = this.keys; int fraction = key * A; int index = fraction >>> (32 - power); if (keys[index] != EMPTY) { int mask = (1 << power) - 1; int step = tableLookupStep(fraction, mask, power); int firstIndex = index; do { if (check && keys[index] == DELETED) Kit.codeBug(); index = (index + step) & mask; if (check && firstIndex == index) Kit.codeBug(); } while (keys[index] != EMPTY); } keys[index] = key; ++occupiedCount; ++keyCount; return index; }
private int findIndex(int key) { int[] keys = this.keys; if (keys != null) { int fraction = key * A; int index = fraction >>> (32 - power); int entry = keys[index]; if (entry == key) { return index; } if (entry != EMPTY) { // Search in table after first failed attempt int mask = (1 << power) - 1; int step = tableLookupStep(fraction, mask, power); int n = 0; do { if (check) { if (n >= occupiedCount) Kit.codeBug(); ++n; } index = (index + step) & mask; entry = keys[index]; if (entry == key) { return index; } } while (entry != EMPTY); } } return -1; }
private int findIndex(int key) { int[] keys = this.keys; if (keys != null) { int fraction = key * A; int index = fraction >>> (32 - power); int entry = keys[index]; if (entry == key) { return index; } if (entry != EMPTY) { // Search in table after first failed attempt int mask = (1 << power) - 1; int step = tableLookupStep(fraction, mask, power); int n = 0; do { if (check) { if (n >= occupiedCount) Kit.codeBug(); ++n; } index = (index + step) & mask; entry = keys[index]; if (entry == key) { return index; } } while (entry != EMPTY); } } return -1; }
private int findIndex(int key) { int[] keys = this.keys; if (keys != null) { int fraction = key * A; int index = fraction >>> (32 - power); int entry = keys[index]; if (entry == key) { return index; } if (entry != EMPTY) { // Search in table after first failed attempt int mask = (1 << power) - 1; int step = tableLookupStep(fraction, mask, power); int n = 0; do { if (check) { if (n >= occupiedCount) Kit.codeBug(); ++n; } index = (index + step) & mask; entry = keys[index]; if (entry == key) { return index; } } while (entry != EMPTY); } } return -1; }
private int findIndex(int key) { int[] keys = this.keys; if (keys != null) { int fraction = key * A; int index = fraction >>> (32 - power); int entry = keys[index]; if (entry == key) { return index; } if (entry != EMPTY) { // Search in table after first failed attempt int mask = (1 << power) - 1; int step = tableLookupStep(fraction, mask, power); int n = 0; do { if (check) { if (n >= occupiedCount) Kit.codeBug(); ++n; } index = (index + step) & mask; entry = keys[index]; if (entry == key) { return index; } } while (entry != EMPTY); } } return -1; }
private int findIndex(int key) { int[] keys = this.keys; if (keys != null) { int fraction = key * A; int index = fraction >>> (32 - power); int entry = keys[index]; if (entry == key) { return index; } if (entry != EMPTY) { // Search in table after first failed attempt int mask = (1 << power) - 1; int step = tableLookupStep(fraction, mask, power); int n = 0; do { if (check) { if (n >= occupiedCount) Kit.codeBug(); ++n; } index = (index + step) & mask; entry = keys[index]; if (entry == key) { return index; } } while (entry != EMPTY); } } return -1; }
private int findIndex(int key) { int[] keys = this.keys; if (keys != null) { int fraction = key * A; int index = fraction >>> (32 - power); int entry = keys[index]; if (entry == key) { return index; } if (entry != EMPTY) { // Search in table after first failed attempt int mask = (1 << power) - 1; int step = tableLookupStep(fraction, mask, power); int n = 0; do { if (check) { if (n >= occupiedCount) Kit.codeBug(); ++n; } index = (index + step) & mask; entry = keys[index]; if (entry == key) { return index; } } while (entry != EMPTY); } } return -1; }
int step = tableLookupStep(fraction, mask, power); int n = 0; do {
int step = tableLookupStep(fraction, mask, power); int n = 0; do {
int step = tableLookupStep(fraction, mask, power); int n = 0; do {
int step = tableLookupStep(fraction, mask, power); int n = 0; do {
int step = tableLookupStep(fraction, mask, power); int n = 0; do {
int step = tableLookupStep(fraction, mask, power); int n = 0; do {