diff --git a/Battleship/Battleship/SetGeneric.cs b/Battleship/Battleship/SetGeneric.cs index fae0f1d..c0e3858 100644 --- a/Battleship/Battleship/SetGeneric.cs +++ b/Battleship/Battleship/SetGeneric.cs @@ -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]