mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 06:18:12 +00:00
AK: Make ByteBuffer::slice(0, size()) a freebie
If you want the whole buffer, we can just give you the buffer itself.
This commit is contained in:
parent
3a5a9a683f
commit
64cb04996f
1 changed files with 3 additions and 0 deletions
|
@ -214,6 +214,9 @@ public:
|
|||
if (is_null())
|
||||
return {};
|
||||
|
||||
if (offset == 0 && size == this->size())
|
||||
return *this;
|
||||
|
||||
// I cannot hand you a slice I don't have
|
||||
VERIFY(offset + size <= this->size());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue