From 17dcb835103ac05012c5a7eafa8c7702cef53390 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 11 Mar 2013 18:09:33 +0300 Subject: Add some fixes after automatic checks. --- src/compoundsprite.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/compoundsprite.cpp') 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; -- cgit v1.2.3-60-g2f50