Skip to content

Commit 950ee9b

Browse files
Merge pull request #1151 from LucTremblay/addParensIfNotParenthesizedExpression
AddParens only if it is not already a ParenthesizedExpressionSyntax
2 parents 1338963 + 1cab219 commit 950ee9b

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)