MCPcopy Create free account
hub / github.com/ZDoom/Raze / Clamp

Method Clamp

source/common/utility/tarray.h:762–770  ·  view source on GitHub ↗

Ensures that the array has at most amount entries. Useful in cases where the initial allocation may be larger than the final result. Resize would create a lot of unneeded code in those cases.

Source from the content-addressed store, hash-verified

760 // Useful in cases where the initial allocation may be larger than the final result.
761 // Resize would create a lot of unneeded code in those cases.
762 void Clamp(unsigned int amount)
763 {
764 if (Count > amount)
765 {
766 // Deleting old entries
767 DoDelete(amount, Count - 1);
768 Count = amount;
769 }
770 }
771 void Alloc(unsigned int amount)
772 {
773 // first destroys all content and then rebuilds the array.

Callers 3

CT_BackSpaceFunction · 0.80
~BFSSearchMethod · 0.80
ReadObjectsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected