Исправление метода вставки в классе SetPlaneGeneric
This commit is contained in:
parent
412fab79a2
commit
98421f8d63
@ -20,17 +20,13 @@ namespace AirPlaneWithRadar
|
||||
}
|
||||
public int Insert(T plain)
|
||||
{
|
||||
if (_places.Count == _maxCount)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
_places.Insert(0, plain);
|
||||
|
||||
|
||||
Insert(plain, 0);
|
||||
return _places.Count;
|
||||
}
|
||||
public int Insert(T plain, int position)
|
||||
{
|
||||
if (position < 0 || _places.Count < position||position > _maxCount)
|
||||
if (position < 0 || _places.Count < position||position > _maxCount || _places.Count == _maxCount)
|
||||
return -1;
|
||||
else if (plain == null)
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user