DEV Community

Discussion on: Sorting in Go – Don’t Reinvent This Wheel

Collapse
 
bjarnemagnussen profile image
Bjarne Magnussen

Thanks for the clear explanations!

One question unrelated to sorting regarding your Swap function, why don't you swap them using tuple assignments:

item[i], item[j] = item[j], item[i]

Was it just to be more expressive in the demonstration?

Collapse
 
delta456 profile image
Swastik Baranwal

Yeah, I agree with you!