Skip to content

Commit 80a6ae5

Browse files
Simplify lambda to method group in OtlpResource.AddMetrics (#18355)
The lambda 'm => GetMetricDataPointCount(m)' can be reduced to the method group 'GetMetricDataPointCount'. The IDE0200 analyzer ('Lambda expression can be removed') fires nondeterministically in command-line builds and was breaking local builds with -warnaserror. Reducing it to a method group removes the latent build break. No behavior change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent cc37bec commit 80a6ae5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Aspire.Dashboard/Otlp/Model/OtlpResource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void AddMetrics(AddContext context, RepeatedField<ScopeMetrics> scopeMetr
7070
{
7171
if (!OtlpHelpers.TryGetOrAddScope(_meters, sm.Scope, Context, TelemetryType.Metrics, out var scope))
7272
{
73-
context.FailureCount += sm.Metrics.Sum(m => GetMetricDataPointCount(m));
73+
context.FailureCount += sm.Metrics.Sum(GetMetricDataPointCount);
7474
continue;
7575
}
7676

0 commit comments

Comments
 (0)