This commit is contained in:
CortexCore
2023-10-24 23:37:59 +08:00
parent 325f63d6bc
commit 3e39e627bc
388 changed files with 29043 additions and 889 deletions

View File

@@ -205,11 +205,11 @@ namespace BITKit
}
public static IEnumerable<T> TrySelectFirst<T>(this IEnumerable<T> self, Action<T> action)
{
if (self.Count() > 0)
if (self.Any())
{
action.Invoke(self.First());
}
return self;
return self;
}
public static bool TryGetAny<T>(this IEnumerable<T> self, Func<T, bool> factory, out T any)
{