PIbd-22 Kaznacheeva E.K. LabWork_4 #9

Closed
kaznacheeva wants to merge 8 commits from LabWork_04 into LabWork_03
Showing only changes of commit 7eaadef863 - Show all commits

View File

@ -40,9 +40,9 @@ namespace Battleship.Generics
}
public bool Remove(int position)
{
if (!(position >= 0 && position < Count))
if (position < 0 || position >= Count)
return false;
_places[position] = null;
_places.RemoveAt(position);
return true;
}
public T? this[int position]