Enhance the bubble sort

Removes the redundant swaps.