mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-26 06:28:35 +01:00
removed the array-based GetRandomEntry method as it made lists have to be typecast
This commit is contained in:
parent
1c8b738555
commit
053aaaf17c
1 changed files with 0 additions and 5 deletions
|
@ -15,11 +15,6 @@ namespace MLEM.Extensions {
|
||||||
/// <param name="entries">The entries to choose from</param>
|
/// <param name="entries">The entries to choose from</param>
|
||||||
/// <typeparam name="T">The entries' type</typeparam>
|
/// <typeparam name="T">The entries' type</typeparam>
|
||||||
/// <returns>A random entry</returns>
|
/// <returns>A random entry</returns>
|
||||||
public static T GetRandomEntry<T>(this Random random, params T[] entries) {
|
|
||||||
return entries[random.Next(entries.Length)];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc cref="GetRandomEntry{T}(System.Random,T[])"/>
|
|
||||||
public static T GetRandomEntry<T>(this Random random, IList<T> entries) {
|
public static T GetRandomEntry<T>(this Random random, IList<T> entries) {
|
||||||
return entries[random.Next(entries.Count)];
|
return entries[random.Next(entries.Count)];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue