From 1f31dd749b7a02fad0ca2b455f5345719db9b5dc Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 4 Feb 2015 10:47:58 +0300 Subject: [PATCH] Break loop early --- lib/checkother.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 6acbe3470..047a546dc 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1742,9 +1742,10 @@ void CheckOther::checkIncompleteStatement() // bailout if there is a "? :" in this statement bool bailout = false; for (const Token *tok2 = tok->tokAt(2); tok2; tok2 = tok2->next()) { - if (tok2->str() == "?") + if (tok2->str() == "?") { bailout = true; - else if (tok2->str() == ";") + break; + } else if (tok2->str() == ";") break; } if (bailout)