Skip to content

Commit b59801d

Browse files
perf: prevent closure creation in AttributeList
1 parent fee0857 commit b59801d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Src/CSharpier.Core/CSharp/SyntaxPrinter/SyntaxNodePrinters/AttributeList.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ node.Parent is CompilationUnitSyntax compilationUnitSyntax
3333

3434
var printSeparatedSyntaxList = SeparatedSyntaxList.Print(
3535
node.Attributes,
36-
(attributeNode, _) =>
36+
static (attributeNode, context) =>
3737
{
3838
var name = Node.Print(attributeNode.Name, context);
3939
if (attributeNode.ArgumentList == null)
@@ -60,7 +60,7 @@ is [
6060
singleCollectionExpression ? Doc.Null : Doc.SoftLine,
6161
SeparatedSyntaxList.Print(
6262
attributeNode.ArgumentList.Arguments,
63-
(attributeArgumentNode, _) =>
63+
static (attributeArgumentNode, context) =>
6464
Doc.Concat(
6565
attributeArgumentNode.NameEquals != null
6666
? NameEquals.Print(

Src/CSharpier.Core/CSharp/SyntaxPrinter/SyntaxNodePrinters/FunctionPointerType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static Doc Print(FunctionPointerTypeSyntax node, PrintingContext context)
1919
Doc.SoftLine,
2020
SeparatedSyntaxList.Print(
2121
node.ParameterList.Parameters,
22-
(o, _) =>
22+
static (o, context) =>
2323
Doc.Concat(
2424
AttributeLists.Print(o, o.AttributeLists, context),
2525
Modifiers.Print(o.Modifiers, context),
@@ -46,7 +46,7 @@ PrintingContext context
4646
Token.Print(node.UnmanagedCallingConventionList.OpenBracketToken, context),
4747
SeparatedSyntaxList.Print(
4848
node.UnmanagedCallingConventionList.CallingConventions,
49-
(o, _) => Token.Print(o.Name, context),
49+
static (o, context) => Token.Print(o.Name, context),
5050
" ",
5151
context
5252
),

Src/CSharpier.Core/CSharp/SyntaxPrinter/SyntaxNodePrinters/OrderByClause.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static Doc Print(OrderByClauseSyntax node, PrintingContext context)
1212
Token.Print(node.OrderByKeyword, context),
1313
SeparatedSyntaxList.Print(
1414
node.Orderings,
15-
(orderingNode, _) =>
15+
static (orderingNode, context) =>
1616
Doc.Concat(
1717
" ",
1818
Node.Print(orderingNode.Expression, context),

Src/CSharpier.Core/CSharp/SyntaxPrinter/SyntaxNodePrinters/RecursivePattern.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ or BinaryPatternSyntax
4343
Doc.SoftLine,
4444
SeparatedSyntaxList.Print(
4545
node.PositionalPatternClause.Subpatterns,
46-
(subpatternNode, _) =>
46+
static (subpatternNode, context) =>
4747
Doc.Concat(
4848
subpatternNode.NameColon != null
4949
? BaseExpressionColon.Print(
@@ -88,7 +88,7 @@ or BinaryPatternSyntax
8888
node.PropertyPatternClause.Subpatterns.Any() ? Doc.Line : Doc.Null,
8989
SeparatedSyntaxList.Print(
9090
node.PropertyPatternClause.Subpatterns,
91-
(subpatternNode, _) =>
91+
static (subpatternNode, context) =>
9292
Doc.Group(
9393
subpatternNode.ExpressionColon != null
9494
? Node.Print(subpatternNode.ExpressionColon, context)

0 commit comments

Comments
 (0)