summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-26 22:49:06 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-26 22:49:06 +0200
commit16accb71a35ad4c947cd9fefc6dc97c2a1ce3adb (patch)
tree4fa3276c24025d86c29519e6bce73d6043012d93 /AK
parent7ed80ae96cb4ac731aff9db7629183154ab72f1b (diff)
downloadserenity-16accb71a35ad4c947cd9fefc6dc97c2a1ce3adb.zip
AK: Mark some popular String member functions ALWAYS_INLINE
I don't wanna see String::length() in a profile, jeez. :^)
Diffstat (limited to 'AK')
-rw-r--r--AK/String.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/AK/String.h b/AK/String.h
index f0b27ce658..443a6b9549 100644
--- a/AK/String.h
+++ b/AK/String.h
@@ -134,10 +134,10 @@ public:
StringView substring_view(size_t start, size_t length) const;
bool is_null() const { return !m_impl; }
- bool is_empty() const { return length() == 0; }
- size_t length() const { return m_impl ? m_impl->length() : 0; }
- const char* characters() const { return m_impl ? m_impl->characters() : nullptr; }
- const char& operator[](size_t i) const
+ ALWAYS_INLINE bool is_empty() const { return length() == 0; }
+ ALWAYS_INLINE size_t length() const { return m_impl ? m_impl->length() : 0; }
+ ALWAYS_INLINE const char* characters() const { return m_impl ? m_impl->characters() : nullptr; }
+ ALWAYS_INLINE const char& operator[](size_t i) const
{
return (*m_impl)[i];
}