提交 921f0e6e 编写于 作者: B Behdad Esfahbod

[vector] Simplify sort

Hopefully this fits fine with SFINAE with all our compilers.
上级 61510b63
...@@ -179,16 +179,11 @@ struct hb_vector_t ...@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册