helping branch prediction
This commit is contained in:
@@ -71,7 +71,7 @@ struct FEffectUpdator
|
||||
}
|
||||
void operator () (CEffectElementBaseInstance * pInstance)
|
||||
{
|
||||
if (pInstance->Update(fElapsedTime))
|
||||
if (pInstance->Update(fElapsedTime)) [[likely]]
|
||||
isAlive = TRUE;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -67,16 +67,13 @@ void CEffectManager::Update()
|
||||
|
||||
pEffectInstance->Update(/*fElapsedTime*/);
|
||||
|
||||
if (!pEffectInstance->isAlive())
|
||||
{
|
||||
itor = m_kEftInstMap.erase(itor);
|
||||
|
||||
CEffectInstance::Delete(pEffectInstance);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pEffectInstance->isAlive()) [[likely]] {
|
||||
++itor;
|
||||
continue;
|
||||
}
|
||||
|
||||
itor = m_kEftInstMap.erase(itor);
|
||||
CEffectInstance::Delete(pEffectInstance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -300,15 +300,13 @@ bool CParticleSystemInstance::OnUpdate(float fElapsedTime)
|
||||
{
|
||||
CParticleInstance * pInstance = *itor;
|
||||
|
||||
if (!pInstance->Update(fElapsedTime,fAngularVelocity))
|
||||
{
|
||||
if (!pInstance->Update(fElapsedTime,fAngularVelocity)) [[unlikely]] {
|
||||
pInstance->DeleteThis();
|
||||
|
||||
itor = m_ParticleInstanceListVector[dwFrameIndex].erase(itor);
|
||||
m_dwCurrentEmissionCount--;
|
||||
}
|
||||
else
|
||||
{
|
||||
else [[likely]] {
|
||||
if (pInstance->m_byFrameIndex != dwFrameIndex)
|
||||
{
|
||||
m_ParticleInstanceListVector[dwFrameCount+pInstance->m_byFrameIndex].push_back(*itor);
|
||||
|
||||
Reference in New Issue
Block a user