Overview
Follow up from @michael-hawker's comment here: #3380 (comment)
There are places in the toolkit were we have verbose expressions to check for null refs or get null refs, eg:
https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/070d69014d8e7e85aa2be2359c0ee564e25b66bc/Microsoft.Toolkit.HighPerformance/Buffers/StringPool.cs#L497
https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/49a88c7d570854026855becbd25ae53c1873417f/Microsoft.Toolkit.HighPerformance/Extensions/ArrayExtensions.cs#L47-L50
There are now portable .NET Standard APIs to do this in a less verbose manner (added in dotnet/runtime#40008), which will be in stable release when .NET 5 drops in November (though they'll just target .NET Standard like the current System.Runtime.CompilerServices.Unsafe package). This issue is for tracking a refactoring pass on the whole toolkit to update all the current instances of those workarounds mentioned above, using these new APIs. Notes:
- No target framework changes
- No API changes
- Purely a refactoring
Overview
Follow up from @michael-hawker's comment here: #3380 (comment)
There are places in the toolkit were we have verbose expressions to check for null refs or get null refs, eg:
https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/070d69014d8e7e85aa2be2359c0ee564e25b66bc/Microsoft.Toolkit.HighPerformance/Buffers/StringPool.cs#L497
https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/49a88c7d570854026855becbd25ae53c1873417f/Microsoft.Toolkit.HighPerformance/Extensions/ArrayExtensions.cs#L47-L50
There are now portable .NET Standard APIs to do this in a less verbose manner (added in dotnet/runtime#40008), which will be in stable release when .NET 5 drops in November (though they'll just target .NET Standard like the current
System.Runtime.CompilerServices.Unsafepackage). This issue is for tracking a refactoring pass on the whole toolkit to update all the current instances of those workarounds mentioned above, using these new APIs. Notes: