From 503e4a08cb208392efcb3a744c1853f91a619e98 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 17 Jul 2015 13:49:32 +0200 Subject: [PATCH] Utils: Properly terminate loop in Environment::diff() The iterator needs to be tested against the end() of the same container. Change-Id: Ia4d208650d922d529ea074d4cd0eac9f4ac76b87 Reviewed-by: BogDan Vatra Reviewed-by: Tobias Hunger --- src/libs/utils/environment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index 298987ee557..9ff5b4be87d 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -376,7 +376,7 @@ QList Environment::diff(const Environment &other) const if (thisIt == constEnd()) { result.append(EnvironmentItem(otherIt.key(), otherIt.value())); ++otherIt; - } else if (otherIt == constEnd()) { + } else if (otherIt == other.constEnd()) { EnvironmentItem item(thisIt.key(), QString()); item.unset = true; result.append(item);