Skip to content

Commit

Permalink
include unversioned
Browse files Browse the repository at this point in the history
  • Loading branch information
cryy22 committed May 4, 2024
1 parent a2bdd46 commit d2bd0b7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Runtime/Common/IReadOnlyListExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Collections.Generic;
using System.Linq;

namespace Crysc.Common
{
public static class ReadOnlyListExtensions
{
public static int IndexOf<T>(this IReadOnlyList<T> list, T element)
{
for (var i = 0; i < list.Count; i++)
if (EqualityComparer<T>.Default.Equals(x: list.ElementAt(i), y: element))
return i;

return -1;
}
}
}
3 changes: 3 additions & 0 deletions Runtime/Common/IReadOnlyListExtensions.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d2bd0b7

Please sign in to comment.