3 ms·
If you want a stable sort, you should always use https://pkg.go.dev/sort#SliceStable https://pkg.go.dev/sort#SliceStable This PR only modifies Slice method whic
by ayanamist 4y ago
If you want a stable sort, you should always use https://pkg.go.dev/sort#SliceStable https://pkg.go.dev/sort#SliceStable
This PR only modifies Slice method which is declared as "is not guaranteed to be stable"
- Asraelite 4y agoGo already randomizes the order of keys in map iterations to discourage relying on undefined behavior. It would be funny if they randomized the order of equal elements in what would otherwise be a stable algorithm for the same reason.