Repository navigation
refactor: refine the code in retrieveWorker to make it more readable - #295
Merged
Merged
Conversation
panjf2000
reviewed
Sep 17, 2023
panjf2000
reviewed
Sep 17, 2023
panjf2000
reviewed
Sep 17, 2023
panjf2000
requested changes
Sep 17, 2023
panjf2000
left a comment
Owner
There was a problem hiding this comment.
Please also apply the same changes in pool_func.go
Contributor
Author
|
All done. @panjf2000 |
panjf2000
reviewed
Sep 17, 2023
panjf2000
reviewed
Sep 17, 2023
Contributor
Author
|
Above done. @panjf2000 |
panjf2000
reviewed
Sep 17, 2023
panjf2000
reviewed
Sep 17, 2023
panjf2000
reviewed
Sep 17, 2023
panjf2000
reviewed
Sep 17, 2023
Contributor
Author
|
Done. @panjf2000 |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev #295 +/- ##
==========================================
+ Coverage 92.48% 94.08% +1.59%
==========================================
Files 9 9
Lines 772 744 -28
==========================================
- Hits 714 700 -14
+ Misses 44 32 -12
+ Partials 14 12 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
panjf2000
reviewed
Sep 17, 2023
panjf2000
reviewed
Sep 17, 2023
… directly below p.Cap().
Contributor
Author
|
Done. @panjf2000 |
retrieveWorker to make it more readable.
retrieveWorker to make it more readable.retrieveWorker to make it more readable
Owner
|
Thank you for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
name: Pull request
about: Propose changes to the code
title: 'make func of retrieveWorker() more readable.'
labels: ''
assignees: ''
1. Are you opening this pull request for bug-fixs, optimizations or new feature?
refactor
2. Please describe how these code changes achieve your intention.
I noticed that when I call
retrieveWorker(), it processes two repetitive functions:detach()andcapacity == -1 || capacity > p.Running()in theelseblock.Thus, I move the
retrylabel to the first instance of thedetach()function and made a little change of if-else block.It didn't affect the logic, but it is more readable.
beforeafter3. Please link to the relevant issues (if any).
No
4. Which documentation changes (if any) need to be made/updated because of this PR?
No
4. Checklist