FlaxEngine / FlaxEngine/FlaxEngine
[Suggestion] Replace 'throw new ArgumentNullException' with 'ArgumentNullException.ThrowIfNull' where applicable
Open
scripting
suggestion
- Dominant language
- C++
- Stars
- 7k
- Forks
- 713
- Avg merge
- 7d 11h
- Merged PRs (30d)
- 19
Description
This is a very minor thing but it is slightly less error-prone and is a little more compact.
```cs
//Before
if (foo == null)
throw new ArgumentNullException(nameof (foo));
//After
ArgumentNullException.ThrowIfNull(foo);
```
Here's an example of where this change would apply
https://github.com/FlaxEngine/FlaxEngine/blob/dcadb11a2045416675c2c85c0fc3d7720d28a123/Source/Engine/Utilities/Extensions.cs#L148
Contributor guide
Assessment
This issue has not been assessed yet.