Tiny improvement. Added small protection against invalid state.
This commit is contained in:
1 parent
b39b4d2f4a
commit
a275c180a5
1 file changed
+1
-1
@@ -187,7 +187,7 @@ namespace Recyclable.Collections
|
|||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public void Add(T item)
|
public void Add(T item)
|
||||||
{
|
{
|
||||||
if (_count == _capacity)
|
if (_count >= _capacity)
|
||||||
{
|
{
|
||||||
RecyclableListHelpers<T>.ResizeAndCopy(this);
|
RecyclableListHelpers<T>.ResizeAndCopy(this);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user