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); } ///