@@ -29,14 +29,15 @@ namespace Grpc.Core;
29
29
public class AuthProperty
30
30
{
31
31
static readonly Encoding EncodingUTF8 = System . Text . Encoding . UTF8 ;
32
- string name ;
33
- byte [ ] valueBytes ;
34
- string ? lazyValue ;
32
+
33
+ private readonly string name ;
34
+ private readonly byte [ ] valueBytes ;
35
+ private string ? lazyValue ;
35
36
36
37
private AuthProperty ( string name , byte [ ] valueBytes )
37
38
{
38
- this . name = GrpcPreconditions . CheckNotNull ( name ) ;
39
- this . valueBytes = GrpcPreconditions . CheckNotNull ( valueBytes ) ;
39
+ this . name = GrpcPreconditions . CheckNotNull ( name , nameof ( name ) ) ;
40
+ this . valueBytes = GrpcPreconditions . CheckNotNull ( valueBytes , nameof ( valueBytes ) ) ;
40
41
}
41
42
42
43
/// <summary>
@@ -57,7 +58,7 @@ public string Value
57
58
{
58
59
get
59
60
{
60
- return lazyValue ?? ( lazyValue = EncodingUTF8 . GetString ( this . valueBytes ) ) ;
61
+ return lazyValue ??= EncodingUTF8 . GetString ( this . valueBytes ) ;
61
62
}
62
63
}
63
64
@@ -81,7 +82,7 @@ public byte[] ValueBytes
81
82
/// <param name="valueBytes">the binary value of the property</param>
82
83
public static AuthProperty Create ( string name , byte [ ] valueBytes )
83
84
{
84
- GrpcPreconditions . CheckNotNull ( valueBytes ) ;
85
+ GrpcPreconditions . CheckNotNull ( valueBytes , nameof ( valueBytes ) ) ;
85
86
var valueCopy = new byte [ valueBytes . Length ] ;
86
87
Buffer . BlockCopy ( valueBytes , 0 , valueCopy , 0 , valueBytes . Length ) ;
87
88
return new AuthProperty ( name , valueCopy ) ;
0 commit comments