2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-09 19:25:53 +00:00

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

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);