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