еще правки лабы 7
This commit is contained in:
parent
504ea1e2a3
commit
470c6c0f03
@ -74,10 +74,7 @@ namespace Sailboat.Generics
|
|||||||
public static T? operator -(BoatsGenericCollection<T, U> collect, int pos)
|
public static T? operator -(BoatsGenericCollection<T, U> collect, int pos)
|
||||||
{
|
{
|
||||||
T? obj = collect._collection[pos];
|
T? obj = collect._collection[pos];
|
||||||
if (obj != null)
|
collect._collection.Remove(pos);
|
||||||
{
|
|
||||||
collect._collection.Remove(pos);
|
|
||||||
}
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,11 +48,6 @@ namespace Sailboat.Generics
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool Insert(T boat, int position)
|
public bool Insert(T boat, int position)
|
||||||
{
|
{
|
||||||
if (boat == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException(nameof(boat));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (position < 0 || position >= _maxCount)
|
if (position < 0 || position >= _maxCount)
|
||||||
throw new BoatNotFoundException(position);
|
throw new BoatNotFoundException(position);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user