-
Notifications
You must be signed in to change notification settings - Fork 8k
slices: remove redundant zeroing in Delete #50760
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
Conversation
😊 Welcome @Deleplace! This is either your first contribution to the Istio istio repo, or it's been You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines Thanks for contributing! Courtesy of your friendly welcome wagon. |
|
Hi @Deleplace. Thanks for your PR. I'm waiting for a istio 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. |
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.
/ok-to-test
/retest test flake is from something else, I already have a PR up to fix |
* upstream/master: Fix service entry merge (istio#50711) fix jwt-claim-route flake (istio#50769) Fix test flake in TestRunComponentsAfterStart (istio#50767) slices: remove redundant zeroing in Delete (istio#50760) Ambient - propagate IPV6 config correctly to CNI agent (istio#50747) Automator: update istio/client-go@master dependency in istio/istio@master (istio#50768) Automator: update ztunnel@master in istio/istio@master (istio#50766) Automator: update ztunnel@master in istio/istio@master (istio#50740) Reduce ztunnel binary minimum size. Fix message (istio#50765) Bump go module deps (istio#50732)
Please provide a description of this PR:
Hi, this very small cleanup is removing the explicit zeroing
s[i] = empty
inslices.Delete
.2 good reasons to do this:
slices.Delete
does now zero/nil out the obsolete elements, since Go 1.22 (1, 2, 3). No need to haveistio.io/istio/pkg/slices
do the zeroing anymore.go.mod
specifiesgo 1.22.0
so we can move forwardTestDelete
did check if the deleted element was garbage collected, but passed "by chance" because the deleted index happened to be last in the slice. In general, the elements leaking were not necessarily the elements being deleted.No change to the unit tests is needed.