This commit is contained in:
CortexCore
2024-04-16 04:15:06 +08:00
parent b673a9438d
commit 0362b2c606
183 changed files with 5695 additions and 1453 deletions

View File

@@ -7,6 +7,21 @@ namespace BITKit
{
public static class MathE
{
public static int GetHash<T>(IEnumerable<T> self)
{
var hash = 0;
foreach (var x in self)
{
if (x is not null)
hash += x.GetHashCode();
}
return hash;
}
public static bool IndexInRange<T>(this IEnumerable<T> self, int index)
{
return index >= 0 && index < self.Count();
}
public static bool Equals<T>(params T[] objs)
{
var a = objs.FirstOrDefault();
@@ -60,7 +75,8 @@ namespace BITKit
{
foreach (var x in b)
{
if (a.Contains(x))
var enumerable = a as T[] ?? a.ToArray();
if (enumerable.Contains(x))
{
}