改了一亿个东西,修了一亿个 BUG
This commit is contained in:
20
Utils/ImmutableArrayExtensions.cs
Normal file
20
Utils/ImmutableArrayExtensions.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Immutable;
|
||||
|
||||
namespace AnotherReplayReader.Utils
|
||||
{
|
||||
static class ImmutableArrayExtensions
|
||||
{
|
||||
public static int? FindIndex<T>(this in ImmutableArray<T> a, Predicate<T> p)
|
||||
{
|
||||
for (var i = 0; i < a.Length; ++i)
|
||||
{
|
||||
if (p(a[i]))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user