CAiFuncMap: Reserve containers before adding entries

Eliminates some reallocation churn.
This commit is contained in:
Lioncash 2020-05-08 16:30:57 -04:00
parent 10c6c6729f
commit a9be7b45b2
1 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@
namespace urde {
CAiFuncMap::CAiFuncMap() {
/* Ai States */
x0_stateFuncs.reserve(55);
x0_stateFuncs.emplace("Patrol", &CAi::Patrol);
x0_stateFuncs.emplace("FollowPattern", &CAi::FollowPattern);
x0_stateFuncs.emplace("Dead", &CAi::Dead);
@ -63,6 +64,7 @@ CAiFuncMap::CAiFuncMap() {
x0_stateFuncs.emplace("PodAttack", &CAi::PodAttack);
/* Ai Triggers */
x10_triggerFuncs.reserve(68);
x10_triggerFuncs.emplace("InAttackPosition", &CAi::InAttackPosition);
x10_triggerFuncs.emplace("Leash", &CAi::Leash);
x10_triggerFuncs.emplace("OffLine", &CAi::OffLine);