MCPcopy Create free account
hub / github.com/Norbyte/bg3se / removeAt

Method removeAt

CoreLib/Base/BaseMap.h:273–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
289private:
290 void InsertToHashMap(T const& key, int keyIdx)

Callers

nothing calls this directly

Calls 3

remove_atMethod · 0.45
pop_lastMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected