Updated GetBot to pop last item off instead of first
Updated `GetX` to expect an IList
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using SptCommon.Annotations;
|
||||
using SptCommon.Annotations;
|
||||
using Core.Models.Eft.Common.Tables;
|
||||
using Core.Models.Utils;
|
||||
using SptCommon.Extensions;
|
||||
@@ -50,7 +50,7 @@ public class BotGenerationCacheService(
|
||||
{
|
||||
try
|
||||
{
|
||||
return bots.PopFirst();
|
||||
return bots.PopLast();
|
||||
}
|
||||
catch (Exception _)
|
||||
{
|
||||
|
||||
@@ -9,14 +9,14 @@ public static class ListExtensions
|
||||
return items;
|
||||
}
|
||||
|
||||
public static T PopFirst<T>(this List<T> source)
|
||||
public static T PopFirst<T>(this IList<T> source)
|
||||
{
|
||||
T r = source.First();
|
||||
source.Remove(source.First());
|
||||
return r;
|
||||
}
|
||||
|
||||
public static T PopLast<T>(this List<T> source)
|
||||
public static T PopLast<T>(this IList<T> source)
|
||||
{
|
||||
T r = source.Last();
|
||||
source.Remove(source.Last());
|
||||
|
||||
Reference in New Issue
Block a user