изменена проверка ограничений массива
This commit is contained in:
parent
eb48bafca8
commit
59d11e7b84
@ -41,7 +41,7 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
|
||||
|
||||
public T? Get(int position)
|
||||
{
|
||||
if (position < 0 || position > Count)
|
||||
if (position < 0 || position >= Count)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@ -57,7 +57,7 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
|
||||
public int Insert(T obj, int position)
|
||||
{
|
||||
|
||||
if (position < 0 || position > Count)
|
||||
if (position < 0 || position >= Count)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@ -89,7 +89,7 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
|
||||
|
||||
public T? Remove(int position)
|
||||
{
|
||||
if (position < 0 || position > Count)
|
||||
if (position < 0 || position >= Count)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user