Skip to content

Commit

Permalink
animation: avoid reallocating the active vector on push_back
Browse files Browse the repository at this point in the history
  • Loading branch information
PaideiaDilemma committed Dec 27, 2024
1 parent bfa9e2e commit 731f250
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/animation/AnimationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ bool CAnimationManager::shouldTickForNext() {

void CAnimationManager::tickDone() {
std::vector<CBaseAnimatedVariable*> active;
// avoid reallocations
active.reserve(m_vActiveAnimatedVariables.size());
for (auto const& av : m_vActiveAnimatedVariables) {
if (av->ok() && av->isBeingAnimated())
active.push_back(av);
Expand Down

0 comments on commit 731f250

Please sign in to comment.