Skip to content

Commit

Permalink
Use IsNull instead of reference equality comparision
Browse files Browse the repository at this point in the history
ExpressionBody is NullExpression when absent.
  • Loading branch information
KirillOsenkov committed Jul 2, 2023
1 parent 467cbe1 commit d9579e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Daniel Grunwald
// Copyright (c) 2017 Daniel Grunwald
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
Expand Down Expand Up @@ -211,7 +211,7 @@ public override void VisitLambdaExpression(LambdaExpression lambdaExpression)

public override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclaration)
{
if (propertyDeclaration.ExpressionBody != null)
if (!propertyDeclaration.ExpressionBody.IsNull)
{
VisitAsSequencePoint(propertyDeclaration.ExpressionBody);
}
Expand All @@ -223,7 +223,7 @@ public override void VisitPropertyDeclaration(PropertyDeclaration propertyDeclar

public override void VisitIndexerDeclaration(IndexerDeclaration indexerDeclaration)
{
if (indexerDeclaration.ExpressionBody != null)
if (!indexerDeclaration.ExpressionBody.IsNull)
{
VisitAsSequencePoint(indexerDeclaration.ExpressionBody);
}
Expand Down

0 comments on commit d9579e9

Please sign in to comment.