mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 02:26:11 +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
|
@ -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…
Reference in a new issue