mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:17:34 +00:00
AK: Mark some popular String member functions ALWAYS_INLINE
I don't wanna see String::length() in a profile, jeez. :^)
This commit is contained in:
parent
7ed80ae96c
commit
16accb71a3
1 changed files with 4 additions and 4 deletions
|
@ -134,10 +134,10 @@ public:
|
||||||
StringView substring_view(size_t start, size_t length) const;
|
StringView substring_view(size_t start, size_t length) const;
|
||||||
|
|
||||||
bool is_null() const { return !m_impl; }
|
bool is_null() const { return !m_impl; }
|
||||||
bool is_empty() const { return length() == 0; }
|
ALWAYS_INLINE bool is_empty() const { return length() == 0; }
|
||||||
size_t length() const { return m_impl ? m_impl->length() : 0; }
|
ALWAYS_INLINE size_t length() const { return m_impl ? m_impl->length() : 0; }
|
||||||
const char* characters() const { return m_impl ? m_impl->characters() : nullptr; }
|
ALWAYS_INLINE const char* characters() const { return m_impl ? m_impl->characters() : nullptr; }
|
||||||
const char& operator[](size_t i) const
|
ALWAYS_INLINE const char& operator[](size_t i) const
|
||||||
{
|
{
|
||||||
return (*m_impl)[i];
|
return (*m_impl)[i];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue