Skip to content

Commit 87ca65a

Browse files
Copilotdavidwengier
andcommitted
Inline TryMapToRazorDocumentPosition call instead of storing result
Removed the intermediate mappedEnd assignment and directly used the TryMapToRazorDocumentPosition result in the if condition. This makes the code cleaner by avoiding the unnecessary variable assignment. Co-authored-by: davidwengier <[email protected]>
1 parent 413cc1d commit 87ca65a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ public IEnumerable<TextChange> GetRazorDocumentEdits(RazorCSharpDocument csharpD
113113
break;
114114
}
115115

116-
mappedEnd = this.TryMapToRazorDocumentPosition(csharpDocument, endIndex, out _, out hostEndIndex);
117-
118-
if (mappedEnd)
116+
if (this.TryMapToRazorDocumentPosition(csharpDocument, endIndex, out _, out hostEndIndex))
119117
{
120118
// If there's a newline in the new text, only take the part before it
121119
var firstNewLine = change.NewText.AssumeNotNull().IndexOfAny(['\n', '\r']);

0 commit comments

Comments
 (0)