@@ -46,11 +46,6 @@ public string? this[string key]
46
46
throw new ArgumentNullException ( nameof ( key ) ) ;
47
47
}
48
48
49
- if ( Store == null )
50
- {
51
- return null ;
52
- }
53
-
54
49
if ( TryGetValue ( key , out var value ) )
55
50
{
56
51
return value ;
@@ -87,10 +82,6 @@ public int Count
87
82
{
88
83
get
89
84
{
90
- if ( Store == null )
91
- {
92
- return 0 ;
93
- }
94
85
return Store . Count ;
95
86
}
96
87
}
@@ -99,26 +90,18 @@ public ICollection<string> Keys
99
90
{
100
91
get
101
92
{
102
- if ( Store == null )
103
- {
104
- return EmptyKeys ;
105
- }
106
93
return Store . Keys ;
107
94
}
108
95
}
109
96
110
97
public bool ContainsKey ( string key )
111
98
{
112
- if ( Store == null )
113
- {
114
- return false ;
115
- }
116
99
return Store . ContainsKey ( key ) ;
117
100
}
118
101
119
102
public bool TryGetValue ( string key , [ MaybeNullWhen ( false ) ] out string ? value )
120
103
{
121
- if ( Store == null )
104
+ if ( Store . Count == 0 )
122
105
{
123
106
value = null ;
124
107
return false ;
@@ -134,7 +117,7 @@ public bool TryGetValue(string key, [MaybeNullWhen(false)] out string? value)
134
117
/// <returns>An <see cref="Enumerator" /> object that can be used to iterate through the collection.</returns>
135
118
public Enumerator GetEnumerator ( )
136
119
{
137
- if ( Store == null || Store . Count == 0 )
120
+ if ( Store . Count == 0 )
138
121
{
139
122
// Non-boxed Enumerator
140
123
return EmptyEnumerator ;
@@ -149,7 +132,7 @@ public Enumerator GetEnumerator()
149
132
/// <returns>An <see cref="IEnumerator{T}" /> object that can be used to iterate through the collection.</returns>
150
133
IEnumerator < KeyValuePair < string , string > > IEnumerable < KeyValuePair < string , string > > . GetEnumerator ( )
151
134
{
152
- if ( Store == null || Store . Count == 0 )
135
+ if ( Store . Count == 0 )
153
136
{
154
137
// Non-boxed Enumerator
155
138
return EmptyIEnumeratorType ;
@@ -164,7 +147,7 @@ IEnumerator<KeyValuePair<string, string>> IEnumerable<KeyValuePair<string, strin
164
147
/// <returns>An <see cref="IEnumerator" /> object that can be used to iterate through the collection.</returns>
165
148
IEnumerator IEnumerable . GetEnumerator ( )
166
149
{
167
- if ( Store == null || Store . Count == 0 )
150
+ if ( Store . Count == 0 )
168
151
{
169
152
// Non-boxed Enumerator
170
153
return EmptyIEnumerator ;
0 commit comments