From a9be7b45b25dcbc5b46843298e8fb625a407841a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 8 May 2020 16:30:57 -0400 Subject: [PATCH] CAiFuncMap: Reserve containers before adding entries Eliminates some reallocation churn. --- Runtime/World/CAiFuncMap.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Runtime/World/CAiFuncMap.cpp b/Runtime/World/CAiFuncMap.cpp index dddab5958..d03b0ceeb 100644 --- a/Runtime/World/CAiFuncMap.cpp +++ b/Runtime/World/CAiFuncMap.cpp @@ -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);