mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
AK: Make StringBuilder::trim use trim and not resize
The ByteBuffer trim function is not fallible but resize is, use trim to keep this function from returning errors.
This commit is contained in:
1 parent
6c5c413108
commit
8c2cef2490
1 file changed
+1
-1
@@ -78,7 +78,7 @@ bool StringBuilder::is_empty() const
|
||||
void StringBuilder::trim(size_t count)
|
||||
{
|
||||
auto decrease_count = min(m_buffer.size(), count);
|
||||
m_buffer.resize(m_buffer.size() - decrease_count);
|
||||
m_buffer.trim(m_buffer.size() - decrease_count, true);
|
||||
}
|
||||
|
||||
ErrorOr<void> StringBuilder::try_append(StringView string)
|
||||
|
||||
Reference in new issue
Block a user