From 7a675e2d649fa9aca3b1da1189141fd5525bad15 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 16 Jul 2015 11:13:21 +0200 Subject: [PATCH] Utils: Make Environment::diff() result not contain common entries The resulting diff contained all the items that were equal as well. Since the function was unused so far, no real harm was done, but the function would be useful to have in the debugger. Change-Id: Ia0b0cea79cfc3ee5442aaf7bb392121590c0f338 Reviewed-by: Tobias Hunger Reviewed-by: Daniel Teske --- src/libs/utils/environment.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index 500b0166266..298987ee557 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -390,7 +390,8 @@ QList Environment::diff(const Environment &other) const result.append(EnvironmentItem(otherIt.key(), otherIt.value())); ++otherIt; } else { - result.append(EnvironmentItem(otherIt.key(), otherIt.value())); + if (thisIt.value() != otherIt.value()) + result.append(EnvironmentItem(otherIt.key(), otherIt.value())); ++otherIt; ++thisIt; }