summaryrefslogtreecommitdiff
path: root/src/compoundsprite.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-11 18:09:33 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-11 18:09:33 +0300
commit17dcb835103ac05012c5a7eafa8c7702cef53390 (patch)
tree422c28adfba13f2161fcfc36943a3903e531490b /src/compoundsprite.cpp
parent84d53b7bb98bb44696ed1bc2c3f132e51394ac00 (diff)
downloadplus-17dcb835103ac05012c5a7eafa8c7702cef53390.tar.gz
plus-17dcb835103ac05012c5a7eafa8c7702cef53390.tar.bz2
plus-17dcb835103ac05012c5a7eafa8c7702cef53390.tar.xz
plus-17dcb835103ac05012c5a7eafa8c7702cef53390.zip
Add some fixes after automatic checks.
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;