-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Do not ignore MemoryMarshal.TryWrite
result
#108661
Conversation
What is the concern? |
Code style, it is unidiomatic to ignore the return value of a |
All the In S.S.Cryptography we do use bool ret = MemoryMarshal.TryWrite(bytes, in this);
Debug.Assert(ret); |
Tagging subscribers to this area: @dotnet/area-system-runtime |
@stephentoub It looks the use of |
Just doesn't seem worth the churn to me. |
6c041cf
to
7650700
Compare
MemoryMarshal.TryWrite
result in Guid
MemoryMarshal.TryWrite
result
@stephentoub minimized churn and rebased |
|
@stephentoub any concern with the new version that switches it to just use This is very minor code cleanup, and so if we don't want to take the churn here I'd be liable to just close it. |
I'm fine either way. |
I'll take this then since it does remove the ignored result and makes the code a little bit cleaner. |
* main: JIT: Model GT_RETURN kills with contained operand (dotnet#111230) Update dependencies from https://github.com/dotnet/runtime-assets build 20250110.2 (dotnet#111290) [NativeAOT/ARM64] Generate frames compatible with Apple compact unwinding (dotnet#107766) Cleanup unused JIT stubs in vm (dotnet#111237) Ensure that Shuffle is marked as HW_Flag_CanBenefitFromConstantProp (dotnet#111303) Fix CMP0173 policy warning with cmake 3.31 (dotnet#110522) [RISC-V] Fix HostActivation.Tests unknown-rid (dotnet#110687) Fix accidentally duplicated global-build-step.yml in runtime-official.yml (dotnet#111302) JIT: run extra SPMI queries for arrays (dotnet#111293) Split the Runtime Shared Framework project and combine legs in the official build (dotnet#111136) Do not ignore `MemoryMarshal.TryWrite` result (dotnet#108661) Update dependencies from https://github.com/dotnet/emsdk build 20250109.1 (dotnet#111263) Clean up in Number.Formatting.cs (dotnet#110955)
It is unidiomatic to ignore the return value of a Try method.
Supersedes #104728