summaryrefslogtreecommitdiff
path: root/src/compoundsprite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compoundsprite.cpp')
-rw-r--r--src/compoundsprite.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp
index 7f7e554a9..45c047060 100644
--- a/src/compoundsprite.cpp
+++ b/src/compoundsprite.cpp
@@ -158,15 +158,11 @@ void CompoundSprite::drawSpritesSDL(Graphics *const graphics,
int CompoundSprite::getWidth() const
{
- const Sprite *base = nullptr;
-
FOR_EACH (SpriteConstIterator, it, mSprites)
{
- if ((base = *it))
- {
- if (base)
- return base->getWidth();
- }
+ const Sprite *const base = *it;
+ if (base)
+ return base->getWidth();
}
return 0;
@@ -174,15 +170,11 @@ int CompoundSprite::getWidth() const
int CompoundSprite::getHeight() const
{
- const Sprite *base = nullptr;
-
FOR_EACH (SpriteConstIterator, it, mSprites)
{
- if ((base = *it))
- {
- if (base)
- return base->getHeight();
- }
+ const Sprite *const base = nullptr;
+ if (base)
+ return base->getHeight();
}
return 0;