mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
StringView: Store a StringImpl* rather than a String*.
This commit is contained in:
parent
6a51093ab1
commit
cdb44be703
3 changed files with 7 additions and 6 deletions
|
@ -5,6 +5,7 @@
|
|||
namespace AK {
|
||||
|
||||
class String;
|
||||
class StringImpl;
|
||||
|
||||
class StringView {
|
||||
public:
|
||||
|
@ -27,7 +28,7 @@ public:
|
|||
++m_length;
|
||||
}
|
||||
}
|
||||
StringView(const AK::String& string);
|
||||
StringView(const String& string);
|
||||
|
||||
bool is_null() const { return !m_characters; }
|
||||
bool is_empty() const { return m_length == 0; }
|
||||
|
@ -59,7 +60,7 @@ public:
|
|||
|
||||
private:
|
||||
friend class String;
|
||||
const AK::String* m_string { nullptr };
|
||||
const StringImpl* m_impl { nullptr };
|
||||
const char* m_characters { nullptr };
|
||||
int m_length { 0 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue