Replaced super slow qsort by much faster std::sort.
std::sort is a template function so the compiler can inline the comparator avoiding unnecessary calls. In contrast, qsort is a non-template function taking a function pointer which results in one function call per comparison operation.
Please register or sign in to comment