From 16f3cb74564cf7c19da6e13666c98aca36094716 Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Tue, 5 Aug 2025 21:24:16 +1000 Subject: updates --- Extensions.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Extensions.cs (limited to 'Extensions.cs') diff --git a/Extensions.cs b/Extensions.cs new file mode 100644 index 0000000..6303c8c --- /dev/null +++ b/Extensions.cs @@ -0,0 +1,23 @@ +namespace Q1Emu; + +using System.Collections.Generic; + +public static class Extensions +{ + public static IEnumerable AllIndexesOf(this IEnumerable arr, T q) + { + var indexes = new List(); + int index = 0; + + foreach (var item in arr) + { + if (EqualityComparer.Default.Equals(item, q)) + { + indexes.Add(index); + } + index++; + } + + return indexes; + } +} \ No newline at end of file -- cgit v1.3.1