mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +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
Notes:
sideshowbarker
2024-07-19 02:27:57 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a5982f86054
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