[arrays] Update ArrayOf.lsearch()

Currently unused apparently
This commit is contained in:
Behdad Esfahbod 2018-11-24 00:58:44 -05:00
parent 22e1857b01
commit 3e26c8d2b1
1 changed files with 13 additions and 4 deletions

View File

@ -545,14 +545,23 @@ struct ArrayOf
return_trace (true);
}
template <typename SearchType>
inline int lsearch (const SearchType &x) const
template <typename T>
inline Type &lsearch (const T &x)
{
unsigned int count = len;
for (unsigned int i = 0; i < count; i++)
if (!this->arrayZ[i].cmp (x))
return i;
return -1;
return this->arrayZ[i];
return Crap (T);
}
template <typename T>
inline const Type &lsearch (const T &x) const
{
unsigned int count = len;
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)