3 ms·
That rand.Shuffle interface looks pretty nice; why wasn't that used for sort?
by millstone 8y ago
That rand.Shuffle interface looks pretty nice; why wasn't that used for sort?
- caspervonb 8y agorand.Shuffle was introduced in 1.10 which is currently the tip, maybe it's a case of lessons learned?
- skj 8y agoBecause instead of one special function (swap) it needs two (swap and compare), and the two refer to the same data. So, put that data in a struct and give it methods.