mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
AK: Inline the basics of VectorIterator
Inlining these allows the compiler to optimize out the assertions in favor of a static range check in many cases.
This commit is contained in:
parent
5ac19ca4fd
commit
72eb13d8e4
1 changed files with 2 additions and 2 deletions
|
@ -54,7 +54,7 @@ public:
|
||||||
bool operator<(const VectorIterator& other) const { return m_index < other.m_index; }
|
bool operator<(const VectorIterator& other) const { return m_index < other.m_index; }
|
||||||
bool operator>(const VectorIterator& other) const { return m_index > other.m_index; }
|
bool operator>(const VectorIterator& other) const { return m_index > other.m_index; }
|
||||||
bool operator>=(const VectorIterator& other) const { return m_index >= other.m_index; }
|
bool operator>=(const VectorIterator& other) const { return m_index >= other.m_index; }
|
||||||
VectorIterator& operator++()
|
ALWAYS_INLINE VectorIterator& operator++()
|
||||||
{
|
{
|
||||||
++m_index;
|
++m_index;
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -71,7 +71,7 @@ public:
|
||||||
m_index = other.m_index;
|
m_index = other.m_index;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
ElementType& operator*() { return m_vector[m_index]; }
|
ALWAYS_INLINE ElementType& operator*() { return m_vector[m_index]; }
|
||||||
size_t operator-(const VectorIterator& other) { return m_index - other.m_index; }
|
size_t operator-(const VectorIterator& other) { return m_index - other.m_index; }
|
||||||
|
|
||||||
bool is_end() const { return m_index == m_vector.size(); }
|
bool is_end() const { return m_index == m_vector.size(); }
|
||||||
|
|
Loading…
Add table
Reference in a new issue