Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Commit c8f3da0

Browse files
author
Lakshmi Priya Sekar
committed
Resolve small nits
1 parent 7e58602 commit c8f3da0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Microsoft.DotNet.CodeFormatting/Rules/HasUnderScoreInPrivateFieldNamesFormattingRule.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ namespace Microsoft.DotNet.CodeFormatting.Rules
2424
internal sealed class HasUnderScoreInPrivateFieldNamesFormattingRule : IFormattingRule
2525
{
2626
private static string[] s_keywordsToIgnore = { "public", "internal", "protected", "const" };
27-
2827
private static readonly SyntaxAnnotation s_annotationMarker = new SyntaxAnnotation();
28+
private static readonly Regex regex = new Regex("^._");
2929

3030
public async Task<Document> ProcessAsync(Document document, CancellationToken cancellationToken)
3131
{
@@ -88,7 +88,6 @@ private async Task<Solution> RenameFields(Solution solution, DocumentId document
8888
private static string GetNewSymbolName(ISymbol symbol)
8989
{
9090
var symbolName = symbol.Name.TrimStart('_');
91-
Regex regex = new Regex("^._");
9291
if (regex.IsMatch(symbolName)) symbolName = symbolName.Remove(0, 2);
9392
if (symbol.IsStatic)
9493
{

0 commit comments

Comments
 (0)