diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-06 22:36:34 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-08-06 22:36:34 +1000 |
| commit | 7a8d2bcd75d88a5429937bf551878c55e1dcf0fd (patch) | |
| tree | 81bc1f259fb8678513aa8b214df4ef72720bb585 /Emulator/Extensions.cs | |
| parent | 16f3cb74564cf7c19da6e13666c98aca36094716 (diff) | |
moved everything to seperate projects, and started compiler work + push and pop instructions added
Diffstat (limited to 'Emulator/Extensions.cs')
| -rw-r--r-- | Emulator/Extensions.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Emulator/Extensions.cs b/Emulator/Extensions.cs new file mode 100644 index 0000000..3cc980d --- /dev/null +++ b/Emulator/Extensions.cs @@ -0,0 +1,23 @@ +namespace Q1.Emulator; + +using System.Collections.Generic; + +public static class Extensions +{ + public static IEnumerable<int> AllIndexesOf<T>(this IEnumerable<T> arr, T q) + { + var indexes = new List<int>(); + int index = 0; + + foreach (var item in arr) + { + if (EqualityComparer<T>.Default.Equals(item, q)) + { + indexes.Add(index); + } + index++; + } + + return indexes; + } +}
\ No newline at end of file |
