Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new BCL APIs from .NET 7/8 #6203

Merged
merged 5 commits into from Mar 4, 2024
Merged

Conversation

huoyaoyuan
Copy link
Contributor

The BCL versions are generally safer and faster.

Comment on lines -335 to +336
public static bool IsAsciiDigit(this char character) => character >= '0' && character <= '9';
[Obsolete("Use char.IsAsciiDigit.")] // can be removed 20240901
public static bool IsAsciiDigit(this char character) => char.IsAsciiDigit(character);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CoreLib version is slightly faster for this.

return degrees * MathF.PI / 180.0f;
}
[Obsolete("Use float.DegressToRadians.")] // can be removed 20240901
public static float DegreesToRadians(float degrees) => float.DegreesToRadians(degrees);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting these in float/double is a very interesting API decision to me.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a whole shebang. personally abstractions over numbers have been loooooooooooong overdue so i'm in hook line and sinker

@smoogipoo smoogipoo merged commit 4ac6b91 into ppy:master Mar 4, 2024
21 checks passed
@huoyaoyuan huoyaoyuan deleted the net8.0/new-api branch March 5, 2024 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants