Исправлен insert
This commit is contained in:
parent
56b0d0de6f
commit
80c18de5db
@ -34,12 +34,7 @@ namespace WarmlyLocomotive
|
||||
/// <returns></returns>
|
||||
public int Insert(T locomotive)
|
||||
{
|
||||
if (_maxCount == Count)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
_places.Insert(0, locomotive);
|
||||
return 0;
|
||||
return Insert(locomotive, 0);
|
||||
}
|
||||
/// <summary>
|
||||
/// Добавление объекта в набор на конкретную позицию
|
||||
@ -49,7 +44,7 @@ namespace WarmlyLocomotive
|
||||
/// <returns></returns>
|
||||
public int Insert(T locomotive, int position)
|
||||
{
|
||||
if (position < 0 || position >= Count || _maxCount == Count)
|
||||
if (position < 0 || position > Count || _maxCount == Count)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user