diff --git a/graphics/tinygl/zrect.cpp b/graphics/tinygl/zrect.cpp index 6643a483228..c91365b3243 100644 --- a/graphics/tinygl/zrect.cpp +++ b/graphics/tinygl/zrect.cpp @@ -104,21 +104,20 @@ void tglPresentBuffer() { } while(restartMerge); rectanglesEnd = rectangles.end(); - do { - Common::List::iterator it1 = rectangles.begin(); - while (it1 != rectangles.end()) { - Common::List::iterator it2 = it1; - ++it2; - while (it2 != rectanglesEnd) { - if ((*it1).rectangle.contains((*it2).rectangle)) { - it2 = rectangles.erase(it2); - } else { - ++it2; - } + + Common::List::iterator it1 = rectangles.begin(); + while (it1 != rectangles.end()) { + Common::List::iterator it2 = it1; + ++it2; + while (it2 != rectanglesEnd) { + if ((*it1).rectangle.contains((*it2).rectangle)) { + it2 = rectangles.erase(it2); + } else { + ++it2; } - ++it1; } - } while(restartMerge); + ++it1; + } Common::List::const_iterator it = c->_drawCallsQueue.begin(); Common::List::const_iterator end = c->_drawCallsQueue.end();