From ae7cb8a0585a6a81a991124f920222cb69cf5bf4 Mon Sep 17 00:00:00 2001 From: MorozovDanil Date: Sun, 14 Apr 2024 19:31:10 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0=20insert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CollectionGenericObjects/MassiveGenericObjects.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ProjectContainerShip/ProjectContainerShip/CollectionGenericObjects/MassiveGenericObjects.cs b/ProjectContainerShip/ProjectContainerShip/CollectionGenericObjects/MassiveGenericObjects.cs index 12404ff..13f4640 100644 --- a/ProjectContainerShip/ProjectContainerShip/CollectionGenericObjects/MassiveGenericObjects.cs +++ b/ProjectContainerShip/ProjectContainerShip/CollectionGenericObjects/MassiveGenericObjects.cs @@ -52,15 +52,7 @@ public class MassiveGenericObjects : ICollectionGenericObjects public bool Insert(T obj) { - for (int i = 0; i < Count; i++) - { - if (_collection[i] == null) - { - _collection[i] = obj; - return true; - } - } - return false; + return Insert(obj, 0); } public bool Insert(T obj, int position)