Skip to content

Commit cb2744a

Browse files
[OpenTelemetry] Refactor Lambda expressions (#6852)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
1 parent 0934203 commit cb2744a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/OpenTelemetry/Trace/TracerProviderSdk.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,15 @@ internal TracerProviderSdk(
255255
if (state.Sources.Count > 0)
256256
{
257257
// Validation of source name is already done in builder.
258-
if (state.Sources.Any(s => WildcardHelper.ContainsWildcard(s)))
258+
if (state.Sources.Any(WildcardHelper.ContainsWildcard))
259259
{
260260
var regex = WildcardHelper.GetWildcardRegex(state.Sources);
261261

262262
// Function which takes ActivitySource and returns true/false to indicate if it should be subscribed to
263263
// or not.
264-
activityListener.ShouldListenTo = activitySource =>
265-
this.supportLegacyActivity ?
266-
string.IsNullOrEmpty(activitySource.Name) || regex.IsMatch(activitySource.Name) :
267-
regex.IsMatch(activitySource.Name);
264+
activityListener.ShouldListenTo = this.supportLegacyActivity ?
265+
(activitySource) => string.IsNullOrEmpty(activitySource.Name) || regex.IsMatch(activitySource.Name) :
266+
(activitySource) => regex.IsMatch(activitySource.Name);
268267
}
269268
else
270269
{

0 commit comments

Comments
 (0)