From d9579e959bb7af57de8b9f6748441d594738a4b1 Mon Sep 17 00:00:00 2001 From: Kirill Osenkov Date: Sat, 1 Jul 2023 18:06:52 -0700 Subject: [PATCH] Use IsNull instead of reference equality comparision ExpressionBody is NullExpression when absent. --- ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs b/ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs index 6e148bd3998..5f99360dee2 100644 --- a/ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/SequencePointBuilder.cs @@ -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 @@ -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); } @@ -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); }