| 271 | } |
| 272 | |
| 273 | void removeAt(int32_t index) |
| 274 | { |
| 275 | auto bucketIndex = bucketFromIndex(index); |
| 276 | auto nextIndex = NextIds[index]; |
| 277 | swapKeyInHashTable(bucketIndex, index, nextIndex); |
| 278 | Keys.remove_at(index); |
| 279 | auto followUpIndex = NextIds.pop_last(); |
| 280 | auto removedIndex = NextIds.size(); |
| 281 | |
| 282 | if (index != removedIndex) { |
| 283 | NextIds[index] = followUpIndex; |
| 284 | auto removedBucketIndex = bucketFromIndex(followUpIndex); |
| 285 | swapKeyInHashTable(removedBucketIndex, removedIndex, index); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | private: |
| 290 | void InsertToHashMap(T const& key, int keyIdx) |