Skip to content

Commit

Permalink
Add AggressiveInlining to Double.CompareTo() and Single.CompareTo() (d…
Browse files Browse the repository at this point in the history
…otnet#56501)

* Add AggressiveInlining to Double.CompareTo() and Single.CompareTo()

As per discussion at dotnet#56493

* Use split inlining

* Revert split inlining
  • Loading branch information
rickbrew authored Aug 20, 2021
1 parent 1067e24 commit 4a4b697
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/Double.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public int CompareTo(object? value)
throw new ArgumentException(SR.Arg_MustBeDouble);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int CompareTo(double value)
{
if (m_value < value) return -1;
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Private.CoreLib/src/System/Single.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public int CompareTo(object? value)
throw new ArgumentException(SR.Arg_MustBeSingle);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int CompareTo(float value)
{
if (m_value < value) return -1;
Expand Down

0 comments on commit 4a4b697

Please sign in to comment.