()
| 141 | } |
| 142 | |
| 143 | private void enlargeIfNeeded() |
| 144 | { |
| 145 | if(used < keys.length*loadFactor) |
| 146 | return; |
| 147 | //enlarge |
| 148 | final byte[] oldSatus = status; |
| 149 | final int[] oldKeys = keys; |
| 150 | |
| 151 | int newSize = getNextPow2TwinPrime(status.length*3/2);//it will actually end up doubling in size since we have twin primes spaced that was |
| 152 | status = new byte[newSize]; |
| 153 | keys = new int[newSize]; |
| 154 | |
| 155 | used = 0; |
| 156 | for(int oldIndex = 0; oldIndex < oldSatus.length; oldIndex++) |
| 157 | if(oldSatus[oldIndex] == OCCUPIED) |
| 158 | add(oldKeys[oldIndex]); |
| 159 | } |
| 160 | |
| 161 | @Override |
| 162 | public void clear() |
no test coverage detected