1
This commit is contained in:
@@ -7,6 +7,10 @@ namespace BITKit
|
||||
{
|
||||
public static class MathE
|
||||
{
|
||||
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();
|
||||
@@ -25,7 +29,6 @@ namespace BITKit
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static IEnumerable<T> Subtract<T>(IEnumerable<T> a, IEnumerable<T> b) where T : IEnumerable
|
||||
{
|
||||
List<T> list = new();
|
||||
@@ -61,7 +64,8 @@ namespace BITKit
|
||||
{
|
||||
foreach (var x in b)
|
||||
{
|
||||
if (a.Contains(x))
|
||||
var enumerable = a as T[] ?? a.ToArray();
|
||||
if (enumerable.Contains(x))
|
||||
{
|
||||
|
||||
}
|
||||
@@ -73,6 +77,7 @@ namespace BITKit
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static IEnumerable<T[]> Combinations<T>(IEnumerable<T> source)
|
||||
{
|
||||
|
Reference in New Issue
Block a user