Skip to content

Commit 1cab219

Browse files
committed
AddParens only if it is not already a ParenthesizedExpressionSyntax
1 parent 1338963 commit 1cab219

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

CodeConverter/Util/CSharpUtil.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ public static SyntaxKind GetExpressionOperatorTokenKind(SyntaxKind op)
131131
/// </summary>
132132
public static ExpressionSyntax AddParens(this ExpressionSyntax expression)
133133
{
134+
if (expression is ParenthesizedExpressionSyntax)
135+
return expression;
134136
return SyntaxFactory.ParenthesizedExpression(expression);
135137
}
136138

0 commit comments

Comments
 (0)