From 38d73a94a789a47637f4375fea73995739da7263 Mon Sep 17 00:00:00 2001 From: Andrey_Abazov Date: Tue, 18 Oct 2022 13:15:50 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A7=D0=B5=D1=82=D0=B2=D0=B5=D1=80=D1=82?= =?UTF-8?q?=D0=B0=D1=8F=20=D0=BB=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0?= =?UTF-8?q?.=20=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D0=BE=D0=B4=D0=B0=20=D0=B2=D1=81=D1=82=D0=B0=D0=B2=D0=BA=D0=B8?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AirBomber/AirBomber/SetAirBombersGeneric.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AirBomber/AirBomber/SetAirBombersGeneric.cs b/AirBomber/AirBomber/SetAirBombersGeneric.cs index 830335e..a743086 100644 --- a/AirBomber/AirBomber/SetAirBombersGeneric.cs +++ b/AirBomber/AirBomber/SetAirBombersGeneric.cs @@ -36,7 +36,7 @@ namespace AirBomber /// public int Insert(T airBomber) { - if (_places.Count >= _maxCount) return -1; + if (_places.Count + 1 >= _maxCount) return -1; _places.Insert(0, airBomber); return 0; } @@ -49,7 +49,7 @@ namespace AirBomber public int Insert(T airBomber, int position) { if (position < 0 || position >= _maxCount) return -1; - if (_places.Count >= _maxCount) return -1; + if (_places.Count + 1 >= _maxCount) return -1; _places.Insert(position, airBomber); return position; }