mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:37:44 +00:00
AK: Mark SimpleIterator::operator*() as ALWAYS_INLINE
This gives the compiler enough information to optimize index validation when using range-for to iterate over a Vector, drastically reducing the cost of such loops.
This commit is contained in:
parent
c4933f9bd7
commit
a5982f8605
1 changed files with 2 additions and 2 deletions
|
@ -72,8 +72,8 @@ public:
|
||||||
return SimpleIterator { m_container, m_index + 1 };
|
return SimpleIterator { m_container, m_index + 1 };
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr const ValueType& operator*() const { return m_container[m_index]; }
|
ALWAYS_INLINE constexpr const ValueType& operator*() const { return m_container[m_index]; }
|
||||||
constexpr ValueType& operator*() { return m_container[m_index]; }
|
ALWAYS_INLINE constexpr ValueType& operator*() { return m_container[m_index]; }
|
||||||
|
|
||||||
constexpr const ValueType* operator->() const { return &m_container[m_index]; }
|
constexpr const ValueType* operator->() const { return &m_container[m_index]; }
|
||||||
constexpr ValueType* operator->() { return &m_container[m_index]; }
|
constexpr ValueType* operator->() { return &m_container[m_index]; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue