From ba9a4d66cec4bd24e334fbfd4e84ed8085622fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F?= <Илья@WIN-RANNDDD> Date: Tue, 10 Oct 2023 17:42:35 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=20?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D0=BD=D0=B0=D1=87?= =?UTF-8?q?=D0=B0=D0=BB=D0=BE=20=D0=BD=D0=B0=D0=B1=D0=BE=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectMonorail/ProjectMonorail/SetGeneric.cs | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/ProjectMonorail/ProjectMonorail/SetGeneric.cs b/ProjectMonorail/ProjectMonorail/SetGeneric.cs index 91fb691..d83f05e 100644 --- a/ProjectMonorail/ProjectMonorail/SetGeneric.cs +++ b/ProjectMonorail/ProjectMonorail/SetGeneric.cs @@ -1,4 +1,6 @@ -namespace ProjectMonorail.Generics +using System.Numerics; + +namespace ProjectMonorail.Generics { /// /// Параметризованный набор объектов @@ -32,24 +34,7 @@ /// public int Insert(T monorail) { - int nullIndex = -1, i; - for (i = 0; i < Count; i++) - { - if (_places[i] == null) - { - nullIndex = i; - break; - } - } - if (nullIndex < 0) - return -1; - - for (i = nullIndex; i > 0; i--) - { - _places[i] = _places[i - 1]; - } - _places[0] = monorail; - return 0; + return Insert(monorail, 0); } ///