parent
5d6b35e2c9
commit
283ed40f33
|
@ -1,5 +1,8 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
#if NET8_0_OR_GREATER
|
||||
using System.Linq;
|
||||
#endif
|
||||
|
||||
using BizHawk.Common.CollectionExtensions;
|
||||
|
||||
|
|
|
@ -302,9 +302,11 @@ namespace BizHawk.Common.CollectionExtensions
|
|||
return str.Substring(startIndex: offset, length: length);
|
||||
}
|
||||
|
||||
#if !NET8_0_OR_GREATER
|
||||
/// <summary>shallow clone</summary>
|
||||
public static Dictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> list)
|
||||
public static Dictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> list) where TKey : notnull
|
||||
=> list.ToDictionary(static kvp => kvp.Key, static kvp => kvp.Value);
|
||||
#endif
|
||||
|
||||
public static bool IsSortedAsc<T>(this IReadOnlyList<T> list)
|
||||
where T : IComparable<T>
|
||||
|
|
Loading…
Reference in New Issue