From 04b9930189da220c8135a2e3e6768e28a9d376e3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 29 Dec 2016 02:03:14 +0300 Subject: Add A_UNLIKELY into AnimatedSprite::update. --- src/resources/sprite/animatedsprite.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/resources/sprite/animatedsprite.cpp b/src/resources/sprite/animatedsprite.cpp index 25c6d0e74..4ec3dedb1 100644 --- a/src/resources/sprite/animatedsprite.cpp +++ b/src/resources/sprite/animatedsprite.cpp @@ -187,7 +187,7 @@ bool AnimatedSprite::play(const std::string &restrict spriteAction) restrict2 bool AnimatedSprite::update(const int time) restrict2 { // Avoid freaking out at first frame or when tick_time overflows - if (time < mLastTime || mLastTime == 0) + if (A_UNLIKELY(time < mLastTime || mLastTime == 0)) mLastTime = time; // If not enough time has passed yet, do nothing @@ -200,7 +200,7 @@ bool AnimatedSprite::update(const int time) restrict2 const Animation *restrict const animation = mAnimation; const Frame *restrict const frame = mFrame; - if (!updateCurrentAnimation(dt)) + if (A_UNLIKELY(!updateCurrentAnimation(dt))) { // Animation finished, reset to default play(SpriteAction::STAND); -- cgit v1.2.3-70-g09d2