Commit 503e4a08 authored by hjk's avatar hjk

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: default avatarBogDan Vatra <bogdan@kde.org>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 6c4c8b8a
...@@ -376,7 +376,7 @@ QList<EnvironmentItem> Environment::diff(const Environment &other) const ...@@ -376,7 +376,7 @@ QList<EnvironmentItem> Environment::diff(const Environment &other) const
if (thisIt == constEnd()) { if (thisIt == constEnd()) {
result.append(EnvironmentItem(otherIt.key(), otherIt.value())); result.append(EnvironmentItem(otherIt.key(), otherIt.value()));
++otherIt; ++otherIt;
} else if (otherIt == constEnd()) { } else if (otherIt == other.constEnd()) {
EnvironmentItem item(thisIt.key(), QString()); EnvironmentItem item(thisIt.key(), QString());
item.unset = true; item.unset = true;
result.append(item); result.append(item);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment