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

Commits on Aug 1, 2023

  1. Update x/exp/slices

    ... and update for the changed API of slices.SortStableFunc.
    
    Should not change behavior
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    336c7ff View commit details
    Browse the repository at this point in the history
  2. Use a straightforward append instead of open-coding it

    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č <mitr@redhat.com>
    mtrmac committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    eb15779 View commit details
    Browse the repository at this point in the history
  3. Avoid a manual sort

    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č <mitr@redhat.com>
    mtrmac committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    1e7f574 View commit details
    Browse the repository at this point in the history
  4. Add a FIXME

    Right now, using slices.SortFunc would not be much shorter.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    b9a0b2b View commit details
    Browse the repository at this point in the history