Refactoring request: Use MathF where possible
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 294
- Avg merge
- 2h 30m
- Merged PRs (30d)
- 4
Description
If you use any of the Math functions like Math.Min() or Math.Cos() or Math.Abs() etc, and you are using floats for all the parameters, then you should probably be using MathF for better performance.
Especially if you are casting to float immediately afterwards.
Note: This is only available if using .NET 6 or later
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by searching the C# source for Math calls whose parameters are floats, especially calls immediately cast to float. Check whether each location targets .NET 6 or later before considering MathF. Done means eligible calls use MathF without changing behavior, while cases requiring Math remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100