From 29ce8ef5e2533a053fcd93ec44fc07e1990ad618 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 1 Jun 2012 21:54:19 +0300 Subject: Small optimisation with iterators in guichan code. --- src/guichan/gui.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/guichan/gui.cpp b/src/guichan/gui.cpp index c96c61737..9e0229f05 100644 --- a/src/guichan/gui.cpp +++ b/src/guichan/gui.cpp @@ -344,9 +344,10 @@ namespace gcn // Check if the widget is present in the "widget with mouse" queue. bool widgetIsPresentInQueue = false; - std::deque::const_iterator iter; - for (iter = mWidgetWithMouseQueue.begin(); - iter != mWidgetWithMouseQueue.end(); + for (std::deque::const_iterator + iter = mWidgetWithMouseQueue.begin(), + iter_end = mWidgetWithMouseQueue.end(); + iter != iter_end; ++ iter) { if (*iter == widget) @@ -857,9 +858,10 @@ namespace gcn // Check if the widget is present in the "widget with mouse" queue. bool widgetIsPresentInQueue = false; - std::deque::const_iterator iter; - for (iter = mWidgetWithMouseQueue.begin(); - iter != mWidgetWithMouseQueue.end(); + for (std::deque::const_iterator + iter = mWidgetWithMouseQueue.begin(), + iter_end = mWidgetWithMouseQueue.end(); + iter != iter_end; ++ iter) { if (*iter == widget) -- cgit v1.2.3-70-g09d2