mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:37:45 +00:00
AK: Remove the m_length member for StringBuilder
Instead we can just use ByteBuffer::size() which already keeps track of the buffer's size.
This commit is contained in:
parent
4c32a128ef
commit
de0aa44bb6
2 changed files with 5 additions and 9 deletions
|
@ -44,9 +44,9 @@ public:
|
|||
[[nodiscard]] StringView string_view() const;
|
||||
void clear();
|
||||
|
||||
[[nodiscard]] size_t length() const { return m_length; }
|
||||
[[nodiscard]] bool is_empty() const { return m_length == 0; }
|
||||
void trim(size_t count) { m_length -= count; }
|
||||
[[nodiscard]] size_t length() const { return m_buffer.size(); }
|
||||
[[nodiscard]] bool is_empty() const { return m_buffer.is_empty(); }
|
||||
void trim(size_t count) { m_buffer.resize(m_buffer.size() - count); }
|
||||
|
||||
template<class SeparatorType, class CollectionType>
|
||||
void join(const SeparatorType& separator, const CollectionType& collection)
|
||||
|
@ -68,7 +68,6 @@ private:
|
|||
|
||||
static constexpr size_t inline_capacity = 128;
|
||||
AK::Detail::ByteBuffer<inline_capacity> m_buffer;
|
||||
size_t m_length { 0 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue