-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
DeltaFIFO cleanup #70801
DeltaFIFO cleanup #70801
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Hi @Adirio. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Following @k8s-ci-robot suggestion: /assign @lavalamp |
/cc |
/ok-to-test |
// map). | ||
delete(f.items, id) | ||
// newDeltas will always have at least one delta, if there is a case where | ||
// it may have no elements, delete f.items[id] (f.queue will ignore elements |
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.
This comment is confusingly worded, as it's talking about a case that is no longer handled here without making that clear.
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.
Will rephrase if this change is accepted.
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 recommend just removing this change and sending it in another PR; the others I can LGTM now but we're probably going to need a few iterations on the comment text here.
sorry, I started reviewing this a while ago and got distracted. I don't agree with the first change (I'm not arguing the existing code is optimal--it should at least be tested). The rest are fine. |
If you still think that we should test for empty slices, I will modify this PR to only include the two last points. |
Remove non-needed else condition Remove non-needed swallow copy Simplify return for IsClosed() Keep amount decrement next to element extraction from the queue Signed-off-by: Adrián Orive <adrian.orive.oneca@gmail.com>
@lavalamp Everything ready and checks passing (except the tide one as it requires LGTM, aproval and priority labels) |
if len(newDeltas) > 0 { | ||
if !exists { | ||
if _, exists := f.items[id]; !exists { |
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 probably wouldn't have made these changes at all but I guess I don't object :)
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.
(meaning, just these two--I'm a fan of the others)
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.
This change will mean nothing for most of the cases, as for now dedup will not yield an empty slice, but should optimize the path for empty slices. But I must agree is mostly a cosmetic change.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Adirio, lavalamp The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I think it is just missing a priority now. Which one should I use? |
/priority important-soon
…On Wed, Nov 14, 2018 at 3:32 PM Adrián ***@***.***> wrote:
I think it is just missing a priority now. Which one should I use?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#70801 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAngltCvThMQD6S2vQRP3m5S2VXq0DPsks5uvKf5gaJpZM4YU2Vp>
.
|
What type of PR is this?
/kind cleanup
/sig api-machinery
What this PR does / why we need it:
It does a clean up of some parts of the
DeltaFIFO
code:EDIT: this change has been removed from this PR as a case where this could be possible was shown by @lavalamp. Instead some cleanup has been made in the same part: the else condition is not needed as delete is a no-op for non-existing keys.
Special notes for your reviewer:
The first and last ones are mostly syntactic sugar, but the middle one should slightly improve the performance.
Does this PR introduce a user-facing change?: