-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update sample.cs #8740
Update sample.cs #8740
Conversation
Minor cleanup: * In `Handle` setter, remove `else`. * In both the constructor and `Load` method, rename `Path` to `path`. * Deleted comment in setter explaining how if the handle is valid, return the handle value. * Got rid of brackets for if-statements with 1 line. * Changed constructor to be expression-bodied. * Deleted some unnecessary empty lines. There's a good amount that could change for this example. One more thing: I came here to fix an error in the `Load` method as it appears in [MSDN](https://learn.microsoft.com/en-us/dotnet/api/microsoft.win32.safehandles.safefilehandle?view=net-7.0) (`&&` should be `||`). That is actually fixed here but the change hasn't been reflected in the site. Does something need to be triggered for this to happen?
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Learn Build status updates of commit 3c8005e: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
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.
Thanks @zacharylayne
Learn Build status updates of commit 3c8005e: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
Summary
Minor cleanup:
Handle
setter, removedelse
.Load
method, renamedPath
topath
.There's a good amount more that could change for this example.
If approved, I'll apply these changes to the snippet for SafeWaitHandle too.