From a69a87c5a81ddbf25a25c5549259da550d207bda Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 23 Jun 2012 02:46:01 +0300 Subject: Improve a bit iterators again. --- src/guichan/widgets/scrollarea.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'src/guichan/widgets/scrollarea.cpp') diff --git a/src/guichan/widgets/scrollarea.cpp b/src/guichan/widgets/scrollarea.cpp index a9d84dd98..c0734a926 100644 --- a/src/guichan/widgets/scrollarea.cpp +++ b/src/guichan/widgets/scrollarea.cpp @@ -536,10 +536,9 @@ namespace gcn graphics->setColor(getForegroundColor()); - int i; - int w = dim.height / 2; - int h = w / 2 + 2; - for (i = 0; i < w / 2; ++i) + const int w = dim.height / 2; + const int h = w / 2 + 2; + for (int i = 0; i < w / 2; ++i) { graphics->drawLine(w - i + offset, i + h + offset, w + i + offset, i + h + offset); @@ -595,10 +594,9 @@ namespace gcn graphics->setColor(getForegroundColor()); - int i; - int w = dim.height / 2; - int h = w + 1; - for (i = 0; i < w / 2; ++i) + const int w = dim.height / 2; + const int h = w + 1; + for (int i = 0; i < w / 2; ++i) { graphics->drawLine(w - i + offset, -i + h + offset, w + i + offset, -i + h + offset); @@ -654,10 +652,9 @@ namespace gcn graphics->setColor(getForegroundColor()); - int i; - int w = dim.width / 2; - int h = w - 2; - for (i = 0; i < w / 2; ++i) + const int w = dim.width / 2; + const int h = w - 2; + for (int i = 0; i < w / 2; ++i) { graphics->drawLine(i + h + offset, w - i + offset, i + h + offset, w + i + offset); @@ -713,10 +710,9 @@ namespace gcn graphics->setColor(getForegroundColor()); - int i; - int w = dim.width / 2; - int h = w + 1; - for (i = 0; i < w / 2; ++i) + const int w = dim.width / 2; + const int h = w + 1; + for (int i = 0; i < w / 2; ++i) { graphics->drawLine(-i + h + offset, w - i + offset, -i + h + offset, w + i + offset); -- cgit v1.2.3-60-g2f50