Moved Signal() to MathExtensions
This commit is contained in:
parent
696151a23c
commit
41e1075da6
|
@ -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
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a slice of the given list
|
||||
/// </summary>
|
|
@ -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
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue