From 41e1075da61c79b1520137107a14db1e8722ba9d Mon Sep 17 00:00:00 2001 From: TiagoRG Date: Fri, 9 Jun 2023 00:54:44 +0100 Subject: [PATCH] Moved Signal() to MathExtensions --- Utils/{Extensions.cs => LinqExtensions.cs} | 12 +----------- Utils/MathExtensions.cs | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 11 deletions(-) rename Utils/{Extensions.cs => LinqExtensions.cs} (94%) create mode 100644 Utils/MathExtensions.cs diff --git a/Utils/Extensions.cs b/Utils/LinqExtensions.cs similarity index 94% rename from Utils/Extensions.cs rename to Utils/LinqExtensions.cs index 7a99c1c..f417bf2 100644 --- a/Utils/Extensions.cs +++ b/Utils/LinqExtensions.cs @@ -1,17 +1,7 @@ namespace AdventOfCode.Utils; -public static class Extensions +public static class LinqExtensions { - public static int Signal(this int x) - { - return x switch - { - < 0 => -1, - > 0 => 1, - _ => 0 - }; - } - /// /// Returns a slice of the given list /// diff --git a/Utils/MathExtensions.cs b/Utils/MathExtensions.cs new file mode 100644 index 0000000..7785629 --- /dev/null +++ b/Utils/MathExtensions.cs @@ -0,0 +1,14 @@ +namespace AdventOfCode.Utils; + +public static class MathExtensions +{ + public static int Signal(this int x) + { + return x switch + { + < 0 => -1, + > 0 => 1, + _ => 0 + }; + } +} \ No newline at end of file