-
Notifications
You must be signed in to change notification settings - Fork 5.1k
add ref local reassignment #7
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
add ref local reassignment #7
Conversation
{ | ||
retval += $"{numbers[ctr]} "; | ||
} | ||
return retval.Trim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that is pre-existing code, but to make snippet shorter what about such ToString()
implementation:
public override string ToString() => string.Join(" ", numbers);
Same remark also for the NumberStoreUpdated.cs file
And build project around the sample.
The newer version shows a sample where the ref local reassignment feature creates more efficient code.
7cd9599
to
ed9ea0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @BillWagner, except I'm wondering what the // #error version
comment in Program.cs means. You can merge when you're ready.
This PR must not be merged until dotnet/docs#4875 |
Thanks @rpetrusha That comment was a test and a reminder to add a note on another issue. |
* add ref local reassignment And build project around the sample. * update code sample The newer version shows a sample where the ref local reassignment feature creates more efficient code. * feedback Use expression bodied members for ToString. * remove the error pragma comment
And build project around the sample.
Sample updates for dotnet/docs#3961