[vector] Simplify sort

Hopefully this fits fine with SFINAE with all our compilers.
This commit is contained in:
Behdad Esfahbod 2018-10-15 22:19:17 -07:00
parent 61510b63c1
commit 921f0e6ec7
1 changed files with 1 additions and 6 deletions

View File

@ -179,16 +179,11 @@ struct hb_vector_t
return nullptr; return nullptr;
} }
inline void qsort (int (*cmp)(const void*, const void*)) inline void qsort (int (*cmp)(const void*, const void*) = Type::cmp)
{ {
::qsort (arrayZ(), len, sizeof (Type), cmp); ::qsort (arrayZ(), len, sizeof (Type), cmp);
} }
inline void qsort (void)
{
::qsort (arrayZ(), len, sizeof (Type), Type::cmp);
}
inline void qsort (unsigned int start, unsigned int end) inline void qsort (unsigned int start, unsigned int end)
{ {
::qsort (arrayZ() + start, end - start, sizeof (Type), Type::cmp); ::qsort (arrayZ() + start, end - start, sizeof (Type), Type::cmp);