Skip to content

Commit

Permalink
Change switch to if/else
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwest committed May 13, 2022
1 parent 62feceb commit eacc315
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,13 @@ public bool ForEach(KeyValuePair<string, object> activityTag)
{
PooledList<OtlpCommon.KeyValue>.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);
}
}

Expand Down

0 comments on commit eacc315

Please sign in to comment.