AK: Add Vector::find_first_index(const T&)

This commit is contained in:
Hüseyin ASLITÜRK 2019-12-18 00:15:36 +03:00 committed by Andreas Kling
parent 3012b224f0
commit 86c6fec890

View file

@ -527,6 +527,14 @@ public:
return find([&](auto& other) { return value == other; });
}
int find_first_index(const T& value)
{
for (int i = 0; i < m_size; ++i) {
if (value == at(i))
return i;
}
return -1;
}
private:
void reset_capacity()
{