@@ -17,7 +17,7 @@ internal static class Check
1717 [ ContractAnnotation ( "value:null => halt" ) ]
1818 public static T NotNull < T > ( [ NoEnumeration ] T value , [ InvokerParameterName ] [ NotNull ] string parameterName )
1919 {
20- if ( ReferenceEquals ( value , null ) )
20+ if ( value == null )
2121 {
2222 NotEmpty ( parameterName , nameof ( parameterName ) ) ;
2323
@@ -33,7 +33,7 @@ public static T NotNull<T>(
3333 [ InvokerParameterName ] [ NotNull ] string parameterName ,
3434 [ NotNull ] string propertyName )
3535 {
36- if ( ReferenceEquals ( value , null ) )
36+ if ( value == null )
3737 {
3838 NotEmpty ( parameterName , nameof ( parameterName ) ) ;
3939 NotEmpty ( propertyName , nameof ( propertyName ) ) ;
@@ -63,7 +63,7 @@ public static IReadOnlyList<T> NotEmpty<T>(IReadOnlyList<T> value, [InvokerParam
6363 public static string NotEmpty ( string value , [ InvokerParameterName ] [ NotNull ] string parameterName )
6464 {
6565 Exception e = null ;
66- if ( ReferenceEquals ( value , null ) )
66+ if ( value == null )
6767 {
6868 e = new ArgumentNullException ( parameterName ) ;
6969 }
@@ -84,8 +84,7 @@ public static string NotEmpty(string value, [InvokerParameterName] [NotNull] str
8484
8585 public static string NullButNotEmpty ( string value , [ InvokerParameterName ] [ NotNull ] string parameterName )
8686 {
87- if ( ! ReferenceEquals ( value , null )
88- && value . Length == 0 )
87+ if ( value != null && value . Length == 0 )
8988 {
9089 NotEmpty ( parameterName , nameof ( parameterName ) ) ;
9190
@@ -116,7 +115,7 @@ public static Type ValidEntityType(Type value, [InvokerParameterName] [NotNull]
116115 {
117116 NotEmpty ( parameterName , nameof ( parameterName ) ) ;
118117
119- throw new ArgumentException ( CoreStrings . InvalidEntityType ( value , parameterName ) ) ;
118+ throw new ArgumentException ( CoreStrings . InvalidEntityType ( value ) ) ;
120119 }
121120
122121 return value ;
0 commit comments