WIP: Make a reciever of FlavorResourceQuantites.For pointer#2689
WIP: Make a reciever of FlavorResourceQuantites.For pointer#2689tenzen-y wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tenzen-y The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
|
Is this an improvement? Since The only reason we used pointer receiver in the |
That sounds reasonable.
If so, shouldn't we use the non pointer func (f FlavorResourceQuantities) Add(fr FlavorResource, v int64) {
if f == nil {
f = make(FlavorResourceQuantities)
}
... |
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
78b9bff to
004ad6c
Compare
Oh, I found the above code doesn't work well. NVM. |
You only change the local f , not the caller. we can replace the Add method with something like |
|
@tenzen-y: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
Yeah, that's right. The reason why failure.
My motivation was to consistently use either a pointer or non-pointer receiver across all functions for the same struct and avoid the pointer map receiver. Let me think another better way... |
|
Relevant code is deleted in #2721, so we can close this PR |
|
PR needs rebase. DetailsInstructions 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-sigs/prow repository. |
|
/close |
|
@mimowo: Closed this PR. DetailsIn response to this:
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-sigs/prow repository. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
For the
FlavorResourceQuantities,Adduses the pointer receiver,Foruses the non pointer receiver.But, it would be better to use either a pointer or nonpointer receiver across all functions for the struct.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?