mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09:00
AK: Inline more of the String and FlyString member functions
This is to help recover some of the performance regression from no longer using DeprecatedFlyString (which was aggressively inlined.)
This commit is contained in:
parent
275985ff3d
commit
7165d69868
Notes:
github-actions[bot]
2025-03-26 02:21:13 +00:00
Author: https://github.com/awesomekling
Commit: 7165d69868
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4092
Reviewed-by: https://github.com/gmta ✅
4 changed files with 7 additions and 42 deletions
|
@ -32,19 +32,19 @@ public:
|
|||
FlyString(String const&);
|
||||
FlyString& operator=(String const&);
|
||||
|
||||
[[nodiscard]] bool is_empty() const;
|
||||
[[nodiscard]] unsigned hash() const;
|
||||
[[nodiscard]] bool is_empty() const { return m_data.byte_count() == 0; }
|
||||
[[nodiscard]] unsigned hash() const { return m_data.hash(); }
|
||||
[[nodiscard]] u32 ascii_case_insensitive_hash() const;
|
||||
|
||||
explicit operator String() const;
|
||||
String to_string() const;
|
||||
|
||||
[[nodiscard]] Utf8View code_points() const;
|
||||
[[nodiscard]] ReadonlyBytes bytes() const;
|
||||
[[nodiscard]] StringView bytes_as_string_view() const;
|
||||
[[nodiscard]] ReadonlyBytes bytes() const { return m_data.bytes(); }
|
||||
[[nodiscard]] StringView bytes_as_string_view() const { return m_data.bytes(); }
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE bool operator==(FlyString const& other) const { return m_data.raw({}) == other.m_data.raw({}); }
|
||||
[[nodiscard]] bool operator==(String const&) const;
|
||||
[[nodiscard]] bool operator==(String const& other) const { return m_data == other; }
|
||||
[[nodiscard]] bool operator==(StringView) const;
|
||||
[[nodiscard]] bool operator==(char const*) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue