Use more effective evaluation order in LanguagePrimitives.IsNullLike() (#10781)
Refactor IsNullLike() to evaluate the most commonly-expected null-like values first.
This commit is contained in:
parent
3bddfcb047
commit
25286eb047
|
@ -1071,7 +1071,7 @@ namespace System.Management.Automation
|
|||
/// </summary>
|
||||
/// <param name="obj">The object to test.</param>
|
||||
/// <returns>True if the object is null.</returns>
|
||||
public static bool IsNullLike(object obj) => obj == DBNull.Value || obj == NullString.Value || IsNull(obj);
|
||||
public static bool IsNullLike(object obj) => IsNull(obj) || obj == DBNull.Value || obj == NullString.Value;
|
||||
|
||||
/// <summary>
|
||||
/// Auxiliary for the cases where we want a new PSObject or null.
|
||||
|
|
Loading…
Reference in a new issue