довлена необязательная проверка при удалении
This commit is contained in:
parent
5aa1c71b4c
commit
a323b124aa
@ -42,7 +42,7 @@ public class ListGenericObjects<T> : ICollectionGenericObjects<T>
|
||||
|
||||
public int Insert(T obj, int position)
|
||||
{
|
||||
if (Count >= _maxCount || position < 0 || position > _maxCount)
|
||||
if (Count >= _maxCount || position < 0 || position >= _maxCount)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
@ -52,7 +52,10 @@ public class StorageCollection<T>
|
||||
|
||||
public void DelCollection(string name)
|
||||
{
|
||||
_storages.Remove(name);
|
||||
if (_storages.ContainsKey(name))
|
||||
{
|
||||
_storages.Remove(name);
|
||||
}
|
||||
}
|
||||
|
||||
public ICollectionGenericObjects<T>? this[string name]
|
||||
|
Loading…
x
Reference in New Issue
Block a user