(BiEntry<K, V> entry, @Nullable BiEntry<K, V> oldEntryForKey)
| 184 | } |
| 185 | |
| 186 | private void insert(BiEntry<K, V> entry, @Nullable BiEntry<K, V> oldEntryForKey) { |
| 187 | int keyBucket = entry.keyHash & mask; |
| 188 | entry.nextInKToVBucket = hashTableKToV[keyBucket]; |
| 189 | hashTableKToV[keyBucket] = entry; |
| 190 | int valueBucket = entry.valueHash & mask; |
| 191 | entry.nextInVToKBucket = hashTableVToK[valueBucket]; |
| 192 | hashTableVToK[valueBucket] = entry; |
| 193 | if (oldEntryForKey == null) { |
| 194 | entry.prevInKeyInsertionOrder = lastInKeyInsertionOrder; |
| 195 | entry.nextInKeyInsertionOrder = null; |
| 196 | if (lastInKeyInsertionOrder == null) { |
| 197 | firstInKeyInsertionOrder = entry; |
| 198 | } else { |
| 199 | lastInKeyInsertionOrder.nextInKeyInsertionOrder = entry; |
| 200 | } |
| 201 | lastInKeyInsertionOrder = entry; |
| 202 | } else { |
| 203 | entry.prevInKeyInsertionOrder = oldEntryForKey.prevInKeyInsertionOrder; |
| 204 | if (entry.prevInKeyInsertionOrder == null) { |
| 205 | firstInKeyInsertionOrder = entry; |
| 206 | } else { |
| 207 | entry.prevInKeyInsertionOrder.nextInKeyInsertionOrder = entry; |
| 208 | } |
| 209 | entry.nextInKeyInsertionOrder = oldEntryForKey.nextInKeyInsertionOrder; |
| 210 | if (entry.nextInKeyInsertionOrder == null) { |
| 211 | lastInKeyInsertionOrder = entry; |
| 212 | } else { |
| 213 | entry.nextInKeyInsertionOrder.prevInKeyInsertionOrder = entry; |
| 214 | } |
| 215 | } |
| 216 | size++; |
| 217 | modCount++; |
| 218 | } |
| 219 | |
| 220 | private BiEntry<K, V> seekByKey(@Nullable Object key, int keyHash) { |
| 221 | for (BiEntry<K, V> entry = hashTableKToV[keyHash & mask]; entry != null; entry = entry.nextInKToVBucket) { |
no outgoing calls
no test coverage detected