Replaced std::sort with std::inplace_merge, saving another factor 2. Former-commit-id: 961c31bb68
961c31bb68