Skip to content
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 x/exp/slices, and some small slice-related cleanups #2066

Merged
merged 4 commits into from
Aug 2, 2023

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Aug 1, 2023

Primarily replaces #2065 ; also a few other changes found during slice usage audit.

See individual commit messages for details.

... and update for the changed API of slices.SortStableFunc.

Should not change behavior

Signed-off-by: Miloslav Trmač <[email protected]>
Using append without a manual allocation and a copy of the
old data has a chance to grow the slice in place, without a sufficiently
smart compiler. And it's simpler.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Rely on the test helper instead.

(On the 2-element array, we really don't care about performance.)

Should not change (test) behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
Right now, using slices.SortFunc would not be much shorter.

Signed-off-by: Miloslav Trmač <[email protected]>
Copy link
Contributor

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vrothberg vrothberg merged commit aca0600 into containers:main Aug 2, 2023
9 checks passed
@mtrmac mtrmac deleted the exp-update branch August 2, 2023 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants