Fix stacktraces for `RangeToExclusive` extension

This commit is contained in:
YoshiRulz 2024-07-10 13:29:31 +10:00
parent 00c103da0b
commit e44810a725
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 2 additions and 1 deletions

View File

@ -67,7 +67,8 @@ namespace BizHawk.Common
{
private const ulong MIN_LONG_NEGATION_AS_ULONG = 9223372036854775808UL;
private static readonly ArithmeticException ExclusiveRangeMinValExc = new ArithmeticException("exclusive range end is min value of integral type");
private static ArithmeticException ExclusiveRangeMinValExc
=> new("exclusive range end is min value of integral type");
/// <returns><paramref name="value"/> if it's contained in <paramref name="range"/>, or else whichever bound of <paramref name="range"/> is closest to <paramref name="value"/></returns>
public static T ConstrainWithin<T>(this T value, Range<T> range) where T : unmanaged, IComparable<T> => value.CompareTo(range.Start) < 0