Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit bea1b9d

Browse files
committed
Merge pull request #2831 from hackcraft/remove_redundant_check
Remove redundant check.
2 parents 1f79ba7 + a54fb49 commit bea1b9d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/System.Linq.Expressions/src/System/Linq/Expressions/DefaultExpression.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public partial class Expression
5858
/// </returns>
5959
public static DefaultExpression Empty()
6060
{
61-
return new DefaultExpression(typeof(void));
61+
return new DefaultExpression(typeof(void)); // Create new object each time for different identity
6262
}
6363

6464
/// <summary>
@@ -71,10 +71,6 @@ public static DefaultExpression Empty()
7171
/// </returns>
7272
public static DefaultExpression Default(Type type)
7373
{
74-
if (type == typeof(void))
75-
{
76-
return Empty();
77-
}
7874
return new DefaultExpression(type);
7975
}
8076
}

0 commit comments

Comments
 (0)