77 * PROGRAMMER: Peter Geinitz (Wayfarer)
88 */
99
10+ // ReSharper disable MemberCanBeInternal
11+ // ReSharper disable MemberCanBePrivate.Global
12+
1013using System ;
1114using System . Collections ;
1215using System . Collections . Generic ;
@@ -122,12 +125,12 @@ public ImmutableLookupMapUnmanaged(IDictionary<TKey, TValue> data)
122125 /// </summary>
123126 public void Dispose ( )
124127 {
125- if ( _disposed ) return ;
128+ if ( _disposed ) return ;
129+
126130 _entries . Dispose ( ) ;
127131 _disposed = true ;
128132 }
129133
130- /// <inheritdoc />
131134 /// <summary>
132135 /// Gets the value associated with the specified key.
133136 /// </summary>
@@ -219,18 +222,24 @@ IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.
219222 return GetEnumerator ( ) ;
220223 }
221224
225+ /// <inheritdoc />
222226 /// <summary>
223227 /// High performance enumerator for iterating over the entries in the lookup map. Uses unsafe code and pointer arithmetic for maximum speed.
224228 /// </summary>
225- /// <seealso cref="System.IDisposable" />
226- /// <seealso cref="System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>" />
227- public unsafe struct Enumerator : IEnumerator < KeyValuePair < TKey , TValue > >
229+ /// <seealso cref="T: System.IDisposable" />
230+ /// <seealso cref="!: System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>" />
231+ public struct Enumerator : IEnumerator < KeyValuePair < TKey , TValue > >
228232 {
229233 private readonly Entry * _entries ;
230234 private readonly int _capacity ;
231235 private int _index ;
232236 private KeyValuePair < TKey , TValue > _current ;
233237
238+ /// <summary>
239+ /// Initializes a new instance of the <see cref="Enumerator"/> struct.
240+ /// </summary>
241+ /// <param name="entries">The entries.</param>
242+ /// <param name="capacity">The capacity.</param>
234243 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
235244 internal Enumerator ( Entry * entries , int capacity )
236245 {
@@ -244,7 +253,6 @@ internal Enumerator(Entry* entries, int capacity)
244253 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
245254 public bool MoveNext ( )
246255 {
247- // Nutzt superschnelle Pointer-Arithmetik statt des Array-Indexers
248256 while ( ++ _index < _capacity )
249257 {
250258 Entry * entry = _entries + _index ;
@@ -254,6 +262,7 @@ public bool MoveNext()
254262 return true ;
255263 }
256264 }
265+
257266 return false ;
258267 }
259268
@@ -267,6 +276,7 @@ public readonly KeyValuePair<TKey, TValue> Current
267276 /// <inheritdoc />
268277 readonly object IEnumerator . Current => Current ;
269278
279+ /// <inheritdoc />
270280 /// <summary>
271281 /// Sets the enumerator to its initial position, which is before the first element in the collection.
272282 /// </summary>
@@ -276,6 +286,7 @@ public void Reset()
276286 _current = default ;
277287 }
278288
289+ /// <inheritdoc />
279290 /// <summary>
280291 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
281292 /// </summary>
0 commit comments