Skip to content

Commit

Permalink
AK: Make Vector::data() ALWAYS_INLINE
Browse files Browse the repository at this point in the history
This was showing up in profiles of Browser, and it really shouldn't be.
  • Loading branch information
IdanHo authored and awesomekling committed Feb 5, 2022
1 parent 3729fd0 commit de7b527
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AK/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ requires(!IsRvalueReference<T>) class Vector {
ALWAYS_INLINE size_t size() const { return m_size; }
size_t capacity() const { return m_capacity; }

StorageType* data()
ALWAYS_INLINE StorageType* data()
{
if constexpr (inline_capacity > 0)
return m_outline_buffer ? m_outline_buffer : inline_buffer();
return m_outline_buffer;
}

StorageType const* data() const
ALWAYS_INLINE StorageType const* data() const
{
if constexpr (inline_capacity > 0)
return m_outline_buffer ? m_outline_buffer : inline_buffer();
Expand Down

0 comments on commit de7b527

Please sign in to comment.