Skip to content

Commit

Permalink
Remove call to First with call to indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
mpidash committed Jul 14, 2023
1 parent 02fc236 commit 68c210f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information.

using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using Analyzer.Utilities;
using Microsoft.CodeAnalysis;
Expand Down Expand Up @@ -30,7 +29,7 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
return;
}

var diagnostic = context.Diagnostics.First();
var diagnostic = context.Diagnostics[0];
var conditionalOperationSpan = diagnostic.AdditionalLocations[0];
var childLocation = diagnostic.AdditionalLocations[1];
if (root.FindNode(conditionalOperationSpan.SourceSpan) is not SyntaxNode conditionalSyntax ||
Expand Down

0 comments on commit 68c210f

Please sign in to comment.