From 8851fd64a6b2382cd4e25f54d625dfe85bf58ad8 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Thu, 21 Dec 2017 03:13:00 +0300 Subject: [PATCH] Break loop early --- lib/checkcondition.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/checkcondition.cpp b/lib/checkcondition.cpp index 1e02633e9..9b6834aef 100644 --- a/lib/checkcondition.cpp +++ b/lib/checkcondition.cpp @@ -632,8 +632,10 @@ void CheckCondition::multiCondition2() } bool changed = false; for (std::set::const_iterator it = vars.begin(); it != vars.end(); ++it) { - if (isVariableChanged(tok1, tok2, *it, nonlocal, _settings)) + if (isVariableChanged(tok1, tok2, *it, nonlocal, _settings)) { changed = true; + break; + } } if (changed) break;