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