Skip to content

Commit 8e9864c

Browse files
Format
cleanup silence some warnings
1 parent 2ac8364 commit 8e9864c

8 files changed

Lines changed: 32 additions & 9 deletions

File tree

0 Bytes
Loading
0 Bytes
Loading

ExtendedSystemObjects/Helper/Enumerator.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212

1313
namespace ExtendedSystemObjects.Helper
1414
{
15+
/// <inheritdoc />
1516
/// <summary>
1617
/// Enumerator Helper
1718
/// </summary>
1819
/// <typeparam name="T">Generic Type, must be unmanaged</typeparam>
19-
/// <seealso cref="System.Collections.Generic.IEnumerator&lt;T&gt;" />
20+
/// <seealso cref="T:System.Collections.Generic.IEnumerator`1" />
2021
internal unsafe struct Enumerator<T> : IEnumerator<T> where T : unmanaged
2122
{
2223
/// <summary>
@@ -46,26 +47,29 @@ public Enumerator(T* data, int length)
4647
_index = -1;
4748
}
4849

50+
/// <inheritdoc />
4951
/// <summary>
5052
/// Gets the current.
5153
/// </summary>
5254
/// <value>
5355
/// The current.
5456
/// </value>
55-
public T Current
57+
public readonly T Current
5658
{
5759
[MethodImpl(MethodImplOptions.AggressiveInlining)]
5860
get => _data[_index];
5961
}
6062

63+
/// <inheritdoc />
6164
/// <summary>
6265
/// Gets the current.
6366
/// </summary>
6467
/// <value>
6568
/// The current.
6669
/// </value>
67-
object IEnumerator.Current => Current;
70+
readonly object IEnumerator.Current => Current;
6871

72+
/// <inheritdoc />
6973
/// <summary>
7074
/// Advances the enumerator to the next element of the collection.
7175
/// </summary>
@@ -75,12 +79,14 @@ public T Current
7579
[MethodImpl(MethodImplOptions.AggressiveInlining)]
7680
public bool MoveNext() => ++_index < _length;
7781

82+
/// <inheritdoc />
7883
/// <summary>
7984
/// Sets the enumerator to its initial position, which is before the first element in the collection.
8085
/// </summary>
8186
[MethodImpl(MethodImplOptions.AggressiveInlining)]
8287
public void Reset() => _index = -1;
8388

89+
/// <inheritdoc />
8490
/// <summary>
8591
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
8692
/// </summary>

ExtendedSystemObjects/IntArray.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public void Resize(int newSize)
140140
}
141141
}
142142

143+
/// <inheritdoc />
143144
/// <summary>
144145
/// Returns an enumerator that iterates through the collection.
145146
/// </summary>
@@ -151,6 +152,7 @@ public IEnumerator<int> GetEnumerator()
151152
return new Enumerator<int>(_ptr, Length);
152153
}
153154

155+
/// <inheritdoc />
154156
/// <summary>
155157
/// Returns an enumerator that iterates through a collection.
156158
/// </summary>
@@ -309,7 +311,7 @@ public void RemoveMultiple(ReadOnlySpan<int> indices)
309311
/// </summary>
310312
public Span<int> AsSpan()
311313
{
312-
return new Span<int>(_ptr, Length);
314+
return new(_ptr, Length);
313315
}
314316

315317
/// <summary>

ExtendedSystemObjects/IntList.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
namespace ExtendedSystemObjects
2222
{
23-
/// <inheritdoc />
23+
/// <inheritdoc cref="IUnmanagedArray" />
2424
/// <summary>
2525
/// A high-performance list of integers backed by unmanaged memory.
2626
/// Supports fast adding, popping, and random access with minimal overhead.
@@ -60,11 +60,13 @@ public IntList(int initialCapacity = 16)
6060
_ptr = (int*)_buffer;
6161
}
6262

63+
/// <inheritdoc />
6364
/// <summary>
6465
/// Gets the number of elements contained in the <see cref="IntList" />.
6566
/// </summary>
6667
public int Length { get; private set; }
6768

69+
/// <inheritdoc />
6870
/// <summary>
6971
/// Gets or sets the element at the specified index.
7072
/// </summary>
@@ -95,6 +97,7 @@ public int this[int i]
9597
}
9698
}
9799

100+
/// <inheritdoc />
98101
/// <summary>
99102
/// Removes at.
100103
/// </summary>
@@ -117,6 +120,7 @@ public void RemoveAt(int index)
117120
Length--;
118121
}
119122

123+
/// <inheritdoc />
120124
/// <summary>
121125
/// Returns an enumerator that iterates through the collection.
122126
/// </summary>
@@ -128,6 +132,7 @@ public IEnumerator<int> GetEnumerator()
128132
return new Enumerator<int>(_ptr, Length);
129133
}
130134

135+
/// <inheritdoc />
131136
/// <summary>
132137
/// Returns an enumerator that iterates through a collection.
133138
/// </summary>
@@ -139,6 +144,7 @@ IEnumerator IEnumerable.GetEnumerator()
139144
return GetEnumerator();
140145
}
141146

147+
/// <inheritdoc />
142148
/// <summary>
143149
/// Resizes the specified new size.
144150
/// </summary>
@@ -155,6 +161,7 @@ public void Resize(int newSize)
155161
Length = newSize;
156162
}
157163

164+
/// <inheritdoc />
158165
/// <summary>
159166
/// Removes all elements from the list. The capacity remains unchanged.
160167
/// </summary>
@@ -270,7 +277,7 @@ public void InsertAt(int index, int value, int count = 1)
270277
/// <returns>A <see cref="Span{Int32}" /> representing the list's contents.</returns>
271278
public Span<int> AsSpan()
272279
{
273-
return new Span<int>((void*)_buffer, Length);
280+
return new((void*)_buffer, Length);
274281
}
275282

276283
/// <summary>

ExtendedSystemObjects/Interfaces/IUnmanagedArray.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
* PROGRAMMER: Peter Geinitz (Wayfarer)
77
*/
88

9+
// ReSharper disable MemberCanBeInternal
10+
// ReSharper disable UnusedMemberInSuper.Global
11+
912
using System;
1013

1114
namespace ExtendedSystemObjects.Interfaces

ExtendedSystemObjects/SortedKvStore.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace ExtendedSystemObjects
2020
{
21-
/// <inheritdoc />
21+
/// <inheritdoc cref="IDisposable" />
2222
/// <summary>
2323
/// Represents a sorted key-value store with integer keys and integer values.
2424
/// Keys are kept sorted internally to allow efficient binary search operations.
@@ -334,6 +334,7 @@ public void Compact()
334334
ArrayPool<int>.Shared.Return(rented);
335335
}
336336

337+
/// <inheritdoc />
337338
/// <summary>
338339
/// Gets the enumerator.
339340
/// </summary>
@@ -349,6 +350,7 @@ public IEnumerator<KeyValuePair<int, int>> GetEnumerator()
349350
}
350351
}
351352

353+
/// <inheritdoc />
352354
/// <summary>
353355
/// Gets the enumerator.
354356
/// </summary>

ExtendedSystemObjects/UnmanagedArray.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public UnmanagedArray(int size)
5959
_ptr = (T*)_buffer;
6060
Clear();
6161
}
62-
62+
/// <inheritdoc />
63+
/// <inheritdoc />
6364
/// <summary>
6465
/// Gets the length.
6566
/// </summary>
@@ -129,6 +130,7 @@ public void RemoveAt(int index)
129130
Length--;
130131
}
131132

133+
/// <inheritdoc />
132134
/// <summary>
133135
/// Returns an enumerator that iterates through the collection.
134136
/// </summary>
@@ -140,6 +142,7 @@ public IEnumerator<T> GetEnumerator()
140142
return new Enumerator<T>(_ptr, Length);
141143
}
142144

145+
/// <inheritdoc />
143146
/// <summary>
144147
/// Returns an enumerator that iterates through a collection.
145148
/// </summary>
@@ -264,7 +267,7 @@ public void EnsureCapacity(int minCapacity)
264267
/// <returns>Return all Values as Span</returns>
265268
public Span<T> AsSpan()
266269
{
267-
return new Span<T>(_ptr, Length);
270+
return new(_ptr, Length);
268271
}
269272

270273
/// <summary>

0 commit comments

Comments
 (0)