From 470c6c0f03006066e8a8ec4b23858b9f9115eca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=BE=D0=BB=D0=B8=D0=BD=D0=B0=20=D0=A7=D1=83=D0=B1?= =?UTF-8?q?=D1=8B=D0=BA=D0=B8=D0=BD=D0=B0?= Date: Sat, 23 Dec 2023 16:32:11 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B5=D1=89=D0=B5=20=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BB=D0=B0=D0=B1=D1=8B=207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sailboat/Sailboat/BoatsGenericCollection.cs | 5 +---- Sailboat/Sailboat/SetGeneric.cs | 5 ----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Sailboat/Sailboat/BoatsGenericCollection.cs b/Sailboat/Sailboat/BoatsGenericCollection.cs index dccf834..9c5176d 100644 --- a/Sailboat/Sailboat/BoatsGenericCollection.cs +++ b/Sailboat/Sailboat/BoatsGenericCollection.cs @@ -74,10 +74,7 @@ namespace Sailboat.Generics public static T? operator -(BoatsGenericCollection collect, int pos) { T? obj = collect._collection[pos]; - if (obj != null) - { - collect._collection.Remove(pos); - } + collect._collection.Remove(pos); return obj; } diff --git a/Sailboat/Sailboat/SetGeneric.cs b/Sailboat/Sailboat/SetGeneric.cs index b49c7e8..45817e1 100644 --- a/Sailboat/Sailboat/SetGeneric.cs +++ b/Sailboat/Sailboat/SetGeneric.cs @@ -48,11 +48,6 @@ namespace Sailboat.Generics /// public bool Insert(T boat, int position) { - if (boat == null) - { - throw new ArgumentNullException(nameof(boat)); - } - if (position < 0 || position >= _maxCount) throw new BoatNotFoundException(position);