Skip to content

Commit

Permalink
Fix stacktraces for RangeToExclusive extension
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshiRulz committed Jul 10, 2024
1 parent 00c103d commit e44810a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/BizHawk.Common/Ranges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public static class RangeExtensions
{
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
Expand Down

0 comments on commit e44810a

Please sign in to comment.