提交 268eca24 编写于 作者: B Behdad Esfahbod

[arrays] Port (unused) ArrayOf.lsearch() to hb_array_t's

上级 830856ba
...@@ -548,20 +548,12 @@ struct ArrayOf ...@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册