MCPcopy Create free account
hub / github.com/adriancable/eternal / Resize

Method Resize

doom/src/tarray.h:352–369  ·  view source on GitHub ↗

Resize Array so that it has exactly amount entries in use.

Source from the content-addressed store, hash-verified

350 }
351 // Resize Array so that it has exactly amount entries in use.
352 void Resize (unsigned int amount)
353 {
354 if (Count < amount)
355 {
356 // Adding new entries
357 Grow (amount - Count);
358 for (unsigned int i = Count; i < amount; ++i)
359 {
360 ::new((void *)&Array[i]) T;
361 }
362 }
363 else if (Count != amount)
364 {
365 // Deleting old entries
366 DoDelete (amount, Count - 1);
367 }
368 Count = amount;
369 }
370 // Reserves amount entries at the end of the array, but does nothing
371 // with them.
372 unsigned int Reserve (unsigned int amount)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected