2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 01:07:43 +00:00

CAiFuncMap: Store std::string_view instances instead of std::string

We only make use of static string entries, so we can make use of
std::string view to elide several memory allocations.
This commit is contained in:
Lioncash
2020-05-08 16:33:29 -04:00
parent a9be7b45b2
commit a0c4b6b3ec
5 changed files with 18 additions and 18 deletions

View File

@@ -78,9 +78,9 @@ void CAi::FluidFXThink(EFluidState state, CScriptWater& water, urde::CStateManag
water.GetFluidPlane().AddRipple(GetMass(), GetUniqueId(), center, GetVelocity(), water, mgr, pos);
}
CAiStateFunc CAi::GetStateFunc(const char* func) { return m_FuncMap->GetStateFunc(func); }
CAiStateFunc CAi::GetStateFunc(std::string_view func) { return m_FuncMap->GetStateFunc(func); }
CAiTriggerFunc CAi::GetTrigerFunc(const char* func) { return m_FuncMap->GetTriggerFunc(func); }
CAiTriggerFunc CAi::GetTriggerFunc(std::string_view func) { return m_FuncMap->GetTriggerFunc(func); }
const CStateMachine* CAi::GetStateMachine() const { return x2c8_stateMachine.GetObj(); }
void CAi::CreateFuncLookup(CAiFuncMap* funcMap) { m_FuncMap = funcMap; }