Убраны лишние строчки.

This commit is contained in:
Павел Сорокин 2022-10-26 15:21:35 +04:00
parent 0449822d9e
commit 2d1622a1b6

View File

@ -19,21 +19,17 @@ namespace Liner
}
public int Insert(T ship)
{
if (_places.Count > _maxCount)
{
return -1;
}
return Insert(ship, 0);
}
public int Insert(T ship, int position)
{
if (position >= _maxCount || position < 0) return -1;
if (position < 0 || position > Count || _maxCount == Count) return -1;
_places.Insert(position, ship);
return position;
}
public T Remove(int position)
{
if (position >= _maxCount || position < 0)
if (position >= Count || position < 0)
{
return null;
}
@ -45,7 +41,7 @@ namespace Liner
{
get
{
if (position >= _places.Count || position < 0)
if (position >= Count || position < 0)
{
return null;
}
@ -53,7 +49,7 @@ namespace Liner
}
set
{
if (position >= _places.Count || position < 0)
if (position >= Count || position < 0)
{
return;
}