It might indeed be the best algorithm for common cases of this specific problem, but there needs to be a fallback when either the input is large or a lot of swaps are being done since otherwise it's O(n^2).
Interesting that other people pointed this out, yet he apparently committed the code anyway.