From fc40808a8aba531b058cf16391ca48a262e7abb5 Mon Sep 17 00:00:00 2001 From: Reijo Tomperi Date: Sun, 6 Dec 2009 22:28:38 +0200 Subject: [PATCH] Minor refactoring for checkother.cpp --- lib/checkother.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 588af43a8..a63c73247 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1538,15 +1538,15 @@ static const Token *checkExecutionPaths(const Token *tok, std::listparse(*tok, foundError, checks); std::list::iterator it; - for (it = checks.begin(); it != checks.end(); ++it) + for (it = checks.begin(); it != checks.end();) { - while (it != checks.end() && (*it)->bailOut()) + if ((*it)->bailOut()) { delete *it; it = checks.erase(it); } - if (it == checks.end()) - break; + else + ++it; } if (checks.empty()) return 0;