-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix language-ext Properties & add tests
- Loading branch information
1 parent
aee56d0
commit 841eed5
Showing
3 changed files
with
67 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using LanguageExt; | ||
using System; | ||
|
||
namespace LeviySoft.Visor.LanguageExt.Internal; | ||
|
||
internal static class Utils | ||
{ | ||
public static int FindIndex<T>(this Seq<T> source, Func<T, bool> predicate) | ||
{ | ||
int index = 0; | ||
foreach (T elem in source) | ||
{ | ||
if (predicate(elem)) | ||
{ | ||
return index; | ||
} | ||
++index; | ||
} | ||
|
||
return -1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters