From 139fc86dbcb8a73bd138118681258dcd22ba7631 Mon Sep 17 00:00:00 2001 From: Petr Onderka Date: Thu, 31 May 2018 01:03:27 +0200 Subject: [PATCH] Simplified combining dictionaries in Telemetry --- src/dotnet/Telemetry/Telemetry.cs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/dotnet/Telemetry/Telemetry.cs b/src/dotnet/Telemetry/Telemetry.cs index 2a88de24f..57c2133c7 100644 --- a/src/dotnet/Telemetry/Telemetry.cs +++ b/src/dotnet/Telemetry/Telemetry.cs @@ -141,14 +141,7 @@ namespace Microsoft.DotNet.Cli.Telemetry { foreach (KeyValuePair measurement in measurements) { - if (eventMeasurements.ContainsKey(measurement.Key)) - { - eventMeasurements[measurement.Key] = measurement.Value; - } - else - { - eventMeasurements.Add(measurement.Key, measurement.Value); - } + eventMeasurements[measurement.Key] = measurement.Value; } } return eventMeasurements; @@ -161,14 +154,7 @@ namespace Microsoft.DotNet.Cli.Telemetry var eventProperties = new Dictionary(_commonProperties); foreach (KeyValuePair property in properties) { - if (eventProperties.ContainsKey(property.Key)) - { - eventProperties[property.Key] = property.Value; - } - else - { - eventProperties.Add(property.Key, property.Value); - } + eventProperties[property.Key] = property.Value; } return eventProperties; }