From 8aebbcd395e2671c2aafc053c339b04434ec0db5 Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 25 Feb 2025 13:29:34 +0000 Subject: [PATCH] Updated `GetArrayValue` to use same logic as optimised `GetCollectionValue` --- Libraries/Core/Utils/RandomUtil.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Libraries/Core/Utils/RandomUtil.cs b/Libraries/Core/Utils/RandomUtil.cs index f4fe1a5f..2a2c54d9 100644 --- a/Libraries/Core/Utils/RandomUtil.cs +++ b/Libraries/Core/Utils/RandomUtil.cs @@ -435,14 +435,6 @@ public class RandomUtil(ISptLogger _logger, ICloner _cloner) public T? GetArrayValue(IEnumerable list) { - var rand = new Random(); - try - { - return list.ElementAt(rand.Next(0, list.Count())); - } - catch (Exception) - { - return default; - } + return GetCollectionValue(list); } }