From 74b3af344a45d3f4b6a4a89d417f01afcc25b85a Mon Sep 17 00:00:00 2001 From: ig Date: Tue, 21 Mar 2023 13:46:15 +0100 Subject: [PATCH] add missing Do extension --- csharp/Lib/Utils/Utils.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/csharp/Lib/Utils/Utils.cs b/csharp/Lib/Utils/Utils.cs index c76476a35..6df10758b 100644 --- a/csharp/Lib/Utils/Utils.cs +++ b/csharp/Lib/Utils/Utils.cs @@ -31,7 +31,13 @@ public static class Utils return (T) Convert.ChangeType(c, type); } - + public static T Do(this T t, Action action) + { + action(); + return t; + } + + [DebuggerStepThrough][MethodImpl(AggressiveInlining | AggressiveOptimization)] public static void Nop(T _) {}