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

replace RuntimeInformation.IsOSPlatform with OperatingSystem.Is* #474

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

cfbao
Copy link
Member

@cfbao cfbao commented Jul 26, 2024

OperatingSystem.Is* methods are newer and more efficient. They are basically constants.
A very rough check suggests that, with these new methods, the native AOT trimmer/linker can even eliminate OS-specific dead code!

See dotnet/aspnetcore#24653

@cfbao cfbao marked this pull request as ready for review July 26, 2024 14:44
@cfbao cfbao requested a review from a team as a code owner July 26, 2024 14:44
@cfbao cfbao merged commit 96473de into main Jul 26, 2024
9 checks passed
@cfbao cfbao deleted the os-method branch July 26, 2024 14:57
@boarnoah
Copy link
Member

How did you find this?

Deprecation Warning isn't appropriate for this, but I wonder if something softer is there that .NET could have used to bring awareness.

@cfbao
Copy link
Member Author

cfbao commented Jul 26, 2024

@boarnoah We were already using both APIs inconsistently within BMX, so I wondered if we should consolidate on a single one, and searched for info specifically.

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.

3 participants