Simplified combining dictionaries in Telemetry
This commit is contained in:
parent
dae5099ffb
commit
139fc86dbc
1 changed files with 2 additions and 16 deletions
|
@ -140,16 +140,9 @@ namespace Microsoft.DotNet.Cli.Telemetry
|
||||||
if (measurements != null)
|
if (measurements != null)
|
||||||
{
|
{
|
||||||
foreach (KeyValuePair<string, double> measurement in measurements)
|
foreach (KeyValuePair<string, double> measurement in measurements)
|
||||||
{
|
|
||||||
if (eventMeasurements.ContainsKey(measurement.Key))
|
|
||||||
{
|
{
|
||||||
eventMeasurements[measurement.Key] = measurement.Value;
|
eventMeasurements[measurement.Key] = measurement.Value;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
eventMeasurements.Add(measurement.Key, measurement.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return eventMeasurements;
|
return eventMeasurements;
|
||||||
}
|
}
|
||||||
|
@ -160,16 +153,9 @@ namespace Microsoft.DotNet.Cli.Telemetry
|
||||||
{
|
{
|
||||||
var eventProperties = new Dictionary<string, string>(_commonProperties);
|
var eventProperties = new Dictionary<string, string>(_commonProperties);
|
||||||
foreach (KeyValuePair<string, string> property in properties)
|
foreach (KeyValuePair<string, string> property in properties)
|
||||||
{
|
|
||||||
if (eventProperties.ContainsKey(property.Key))
|
|
||||||
{
|
{
|
||||||
eventProperties[property.Key] = property.Value;
|
eventProperties[property.Key] = property.Value;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
eventProperties.Add(property.Key, property.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return eventProperties;
|
return eventProperties;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue