поменял возвращаемое значение для минуса

This commit is contained in:
antoc0der 2023-10-19 21:18:44 +03:00
parent 826cc3be3b
commit 21721ee795

View File

@ -25,19 +25,16 @@ namespace ProjectAirplaneWithRadar.Generics
{
if (obj == null || collect == null)
{
return -1;
return -1;
}
return collect._collection.Insert(obj);
}
public static T? operator -(AirplanesGenericCollection<T, U> collect, int pos)
public static bool operator -(AirplanesGenericCollection<T, U> collect, int pos)
{
T? obj = collect._collection.Get(pos);
if (obj != null)
{
collect._collection.Remove(pos);
}
return obj;
T? obj = collect?._collection.Get(pos);
if (obj != null && collect != null)
return collect._collection.Remove(pos);
return false;
}
public U? GetU(int pos)
{