[arrays] Port (unused) ArrayOf.lsearch() to hb_array_t's
This commit is contained in:
parent
830856ba6b
commit
268eca2492
|
@ -548,20 +548,12 @@ struct ArrayOf
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline Type &lsearch (const T &x)
|
inline Type &lsearch (const T &x)
|
||||||
{
|
{
|
||||||
unsigned int count = len;
|
return *as_array ().lsearch (x, &Crap (T));
|
||||||
for (unsigned int i = 0; i < count; i++)
|
|
||||||
if (!this->arrayZ[i].cmp (x))
|
|
||||||
return this->arrayZ[i];
|
|
||||||
return Crap (T);
|
|
||||||
}
|
}
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline const Type &lsearch (const T &x) const
|
inline const Type &lsearch (const T &x) const
|
||||||
{
|
{
|
||||||
unsigned int count = len;
|
return *as_array ().lsearch (x, &Null (T));
|
||||||
for (unsigned int i = 0; i < count; i++)
|
|
||||||
if (!this->arrayZ[i].cmp (x))
|
|
||||||
return this->arrayZ[i];
|
|
||||||
return Null (T);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void qsort (void)
|
inline void qsort (void)
|
||||||
|
|
Loading…
Reference in New Issue