Skip to content

Commit 413cc1d

Browse files
CopilotToddGrun
andcommitted
Simplify TryGetAbsoluteIndex check by using result directly in if condition
Changed from storing the result in endSync variable and checking it separately to directly using the TryGetAbsoluteIndex result in the if condition with negation. This makes the code more concise and easier to read. Co-authored-by: ToddGrun <[email protected]>
1 parent abe2533 commit 413cc1d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentMapping/AbstractDocumentMappingService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ public IEnumerable<TextChange> GetRazorDocumentEdits(RazorCSharpDocument csharpD
108108
// gave us, and see if we can map that.
109109

110110
// Get the end of the start line
111-
var endSync = csharpSourceText.TryGetAbsoluteIndex(startLine, csharpSourceText.Lines[startLine].Span.Length, out var endIndex);
112-
if (endSync is false)
111+
if (!csharpSourceText.TryGetAbsoluteIndex(startLine, csharpSourceText.Lines[startLine].Span.Length, out var endIndex))
113112
{
114113
break;
115114
}

0 commit comments

Comments
 (0)