Skip to content

Commit 89efed2

Browse files
CR Feedback: Use separate string literals for clarity
1 parent cd2e39b commit 89efed2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/RazorHtmlWriter.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ namespace Microsoft.AspNetCore.Razor.Language;
1616
// not all characters in the document are included in the ClassifiedSpans.
1717
internal sealed class RazorHtmlWriter : SyntaxWalker
1818
{
19-
// 32 '~' characters followed by comment start and end text.
20-
private const string KnownText = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/**/";
21-
22-
private static ReadOnlyMemory<char> Tildes => KnownText.AsMemory(0, 32);
23-
private static ReadOnlyMemory<char> CommentStart => KnownText.AsMemory(32, 2);
24-
private static ReadOnlyMemory<char> CommentEnd => KnownText.AsMemory(34, 2);
19+
private static ReadOnlyMemory<char> Tildes => "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~".AsMemory(); // 32 '~' characters
20+
private static ReadOnlyMemory<char> CommentStart => "/*".AsMemory();
21+
private static ReadOnlyMemory<char> CommentEnd => "*/".AsMemory();
2522

2623
private readonly RazorSourceDocument _source;
2724
private readonly CodeWriter _codeWriter;

0 commit comments

Comments
 (0)