all: drop x/exp direct dependency #30558
Open
+11
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a not-particularly-important "cleanliness" PR. It removes the last remnants of the
x/exp
package, where we used themaps.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.