Move code around

This commit is contained in:
Behdad Esfahbod 2021-03-29 17:32:29 -06:00
parent bcb57dccaa
commit 7a2eda7817
1 changed files with 13 additions and 13 deletions

View File

@ -619,6 +619,19 @@ struct ArrayOf
hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */)
{ return as_array ().sub_array (start_offset, count); }
template <typename T>
Type &lsearch (const T &x, Type &not_found = Crap (Type))
{ return *as_array ().lsearch (x, &not_found); }
template <typename T>
const Type &lsearch (const T &x, const Type &not_found = Null (Type)) const
{ return *as_array ().lsearch (x, &not_found); }
template <typename T>
bool lfind (const T &x, unsigned *pos = nullptr) const
{ return as_array ().lfind (x, pos); }
void qsort (unsigned int start = 0, unsigned int end = (unsigned int) -1)
{ as_array ().qsort (start, end); }
hb_success_t serialize (hb_serialize_context_t *c, unsigned items_len)
{
TRACE_SERIALIZE (this);
@ -676,19 +689,6 @@ struct ArrayOf
return_trace (true);
}
template <typename T>
Type &lsearch (const T &x, Type &not_found = Crap (Type))
{ return *as_array ().lsearch (x, &not_found); }
template <typename T>
const Type &lsearch (const T &x, const Type &not_found = Null (Type)) const
{ return *as_array ().lsearch (x, &not_found); }
template <typename T>
bool lfind (const T &x, unsigned *pos = nullptr) const
{ return as_array ().lfind (x, pos); }
void qsort (unsigned int start = 0, unsigned int end = (unsigned int) -1)
{ as_array ().qsort (start, end); }
bool sanitize_shallow (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);