Pre-allocate 8 elements to skip trivial reallocations near the beginning of the vectors life.
This commit is contained in:
parent
be79dee6e0
commit
ba0406930d
@ -441,6 +441,7 @@ FeatureStatus SDKHooks::GetFeatureStatus(FeatureType type, const char *name)
|
||||
|
||||
static void CopyEntityVector(const ke::Vector<HookList> &source, ke::Vector<IPluginFunction *> &destination, int entity)
|
||||
{
|
||||
destination.ensure(8); /* Skip trivial allocations as AMTL uses length<<1. */
|
||||
for (size_t iter = 0; iter < source.length(); ++iter)
|
||||
{
|
||||
if (source[iter].entity != entity)
|
||||
|
Loading…
Reference in New Issue
Block a user