This commit is contained in:
Вячеслав Иванов 2023-12-26 19:55:29 +04:00
parent 8ebc7de21d
commit 644a928f8e

View File

@ -79,7 +79,7 @@ namespace PIbd_23_Ivanov_V.N._DoubleDeckerBus._Base.Generics
/// <returns></returns>
public void Remove(int position)
{
if (position < 0 || position >= Count)
if (!(position >= 0 && position < Count))
{
throw new BusNotFoundException(position);
}
@ -96,7 +96,7 @@ namespace PIbd_23_Ivanov_V.N._DoubleDeckerBus._Base.Generics
{
get
{
if (position < 0 || position >= _maxCount)
if (!(position >= 0 && position < Count))
{
return null;
}
@ -109,9 +109,7 @@ namespace PIbd_23_Ivanov_V.N._DoubleDeckerBus._Base.Generics
{
return;
}
_places.Insert(position, value);
return;
}
}