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

all: drop x/exp direct dependency #30558

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Oct 8, 2024

This is a not-particularly-important "cleanliness" PR. It removes the last remnants of the x/exp package, where we used the maps.Keys function.

The original returned the keys in a slice, but when it became 'native' the signature changed to return an iterator, so the new idiom is slices.Collect(maps.Keys(theMap)), unless of course the raw iterator can be used instead.

In some cases, where we previously collect into slice and then sort, we can now instead do slices.SortXX on the iterator instead, making the code a bit more concise.

This PR might be slighly less optimal, because the original x/exp implementation allocated the slice at the correct size off the bat, which I suppose the new code won't.

Putting it up for discussion.

@holiman
Copy link
Contributor Author

holiman commented Oct 8, 2024

Ah, the slices.SortedFunc requires 1.23. Guess this PR will have to wait

@holiman holiman added the status:marinating PR hasn't been open long enough to get merged label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:marinating PR hasn't been open long enough to get merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant