mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05: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 };
|
||||
}
|
||||
|
||||
constexpr const ValueType& operator*() const { return m_container[m_index]; }
|
||||
constexpr ValueType& operator*() { return m_container[m_index]; }
|
||||
ALWAYS_INLINE constexpr const ValueType& operator*() const { 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 ValueType* operator->() { return &m_container[m_index]; }
|
||||
|
|
Loading…
Reference in a new issue