From eacc315ffee0b92832b466a62e5222c12ea49345 Mon Sep 17 00:00:00 2001 From: Alan West <3676547+alanwest@users.noreply.github.com> Date: Fri, 13 May 2022 13:23:24 -0700 Subject: [PATCH] Change switch to if/else --- .../Implementation/ActivityExtensions.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ActivityExtensions.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ActivityExtensions.cs index 62110466bd4..6ec0710b17d 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ActivityExtensions.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ActivityExtensions.cs @@ -360,14 +360,13 @@ public bool ForEach(KeyValuePair activityTag) { PooledList.Add(ref this.Tags, attribute); - switch (attribute.Value.ValueCase) + if (attribute.Value.ValueCase == OtlpCommon.AnyValue.ValueOneofCase.StringValue) { - case OtlpCommon.AnyValue.ValueOneofCase.StringValue: - PeerServiceResolver.InspectTag(ref this, key, attribute.Value.StringValue); - break; - case OtlpCommon.AnyValue.ValueOneofCase.IntValue: - PeerServiceResolver.InspectTag(ref this, key, attribute.Value.IntValue); - break; + PeerServiceResolver.InspectTag(ref this, key, attribute.Value.StringValue); + } + else if (attribute.Value.ValueCase == OtlpCommon.AnyValue.ValueOneofCase.IntValue) + { + PeerServiceResolver.InspectTag(ref this, key, attribute.Value.IntValue); } }