Skip to content

Commit

Permalink
Make StandardFormat.ctor inlineable
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo committed Mar 8, 2020
1 parent 5c981af commit b7f15b7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ namespace System.Buffers
/// <param name="precision">An optional precision ranging from 0..9 or the special value NoPrecision (the default)</param>
public StandardFormat(char symbol, byte precision = NoPrecision)
{
if (precision != NoPrecision && precision > MaxPrecision)
// Optimized version of "precision != NoPrecision && precision > MaxPrecision"
// it makes StandardFormat inlinenable
if ((byte)(precision - (MaxPrecision + 1)) < (NoPrecision - (MaxPrecision + 1)))
ThrowHelper.ThrowArgumentOutOfRangeException_PrecisionTooLarge();
if (symbol != (byte)symbol)
ThrowHelper.ThrowArgumentOutOfRangeException_SymbolDoesNotFit();
Expand Down

0 comments on commit b7f15b7

Please # to comment.