diff --git a/src/RandomExtensions/Collections/IWeightedCollection.cs b/src/RandomExtensions/Collections/IWeightedCollection.cs index 229f572..3e34a24 100644 --- a/src/RandomExtensions/Collections/IWeightedCollection.cs +++ b/src/RandomExtensions/Collections/IWeightedCollection.cs @@ -2,6 +2,6 @@ namespace RandomExtensions.Collections; public interface IWeightedCollection : IReadOnlyCollection> { - T GetItem(TRandom random) where TRandom : IRandom; - void GetItems(TRandom random, Span destination) where TRandom : IRandom; + T GetItem(IRandom random); + void GetItems(IRandom random, Span destination); } \ No newline at end of file diff --git a/src/RandomExtensions/Collections/WeightedList.cs b/src/RandomExtensions/Collections/WeightedList.cs index b9b6c88..a4c5116 100644 --- a/src/RandomExtensions/Collections/WeightedList.cs +++ b/src/RandomExtensions/Collections/WeightedList.cs @@ -124,8 +124,7 @@ public Enumerator GetEnumerator() return new Enumerator(this); } - public T GetItem(TRandom random) - where TRandom : IRandom + public T GetItem(IRandom random) { var r = random.NextDouble() * totalWeight; var current = 0.0; @@ -142,8 +141,7 @@ public T GetItem(TRandom random) return default!; } - public void GetItems(TRandom random, Span destination) - where TRandom : IRandom + public void GetItems(IRandom random, Span destination) { for (int i = 0; i < destination.Length; i++) {