Skip to content

Commit

Permalink
Ue AOOE.ThrowIf method
Browse files Browse the repository at this point in the history
  • Loading branch information
huoyaoyuan committed Feb 3, 2024
1 parent e328288 commit 563dd5d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
5 changes: 1 addition & 4 deletions src/libraries/Common/src/System/Number.Formatting.Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -764,10 +764,7 @@ private static unsafe void FormatFixed<TChar>(
}

groupSizeCount += groupDigits[groupSizeIndex];
if ((groupSizeCount | bufferSize) < 0)
{
ThrowHelper.ThrowArgumentOutOfRangeException(); // If we overflow
}
ArgumentOutOfRangeException.ThrowIfNegative(groupSizeCount | bufferSize, string.Empty); // If we overflow
}

groupSize = groupSizeCount == 0 ? 0 : groupDigits[0]; // If you passed in an array with one entry as 0, groupSizeCount == 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,5 @@ internal static void ThrowFormatException_BadFormatSpecifier()
{
throw new FormatException(SR.Argument_BadFormatSpecifier);
}

[DoesNotReturn]
internal static void ThrowArgumentOutOfRangeException()
{
throw new ArgumentOutOfRangeException();
}
}
}

0 comments on commit 563dd5d

Please sign in to comment.