1
0
mirror of synced 2025-01-26 07:53:44 +01:00

14 lines
344 B
C#
Raw Normal View History

2022-09-18 22:35:51 +08:00
namespace SharedProject.Utils;
public static class ValueHelpers
{
public static T Min<T>(T a, T b) where T : IComparable
{
return Comparer<T>.Default.Compare(a, b) <= 0 ? a : b;
}
public static T Max<T>(T a, T b) where T : IComparable
{
return Comparer<T>.Default.Compare(a, b) >= 0 ? a : b;
}
}