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 <bogdan@kde.org>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
hjk
2015-07-17 13:49:32 +02:00
parent 6c4c8b8a94
commit 503e4a08cb

View File

@@ -376,7 +376,7 @@ QList<EnvironmentItem> 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);