From 7eaadef863aa647b4071d987c616f990fe0268c0 Mon Sep 17 00:00:00 2001 From: kaznacheeva Date: Sun, 5 Nov 2023 23:44:22 +0400 Subject: [PATCH] =?UTF-8?q?=D1=87=D1=83=D1=82=D1=8C=20=D1=87=D1=83=D1=82?= =?UTF-8?q?=D1=8C=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D0=B0?= =?UTF-8?q?,=20=D0=B4=D1=83=D0=BC=D0=B0=D1=8E=20=D0=B3=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Battleship/Battleship/SetGeneric.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]