mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 08:56:40 +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())
|
if (is_null())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
|
if (offset == 0 && size == this->size())
|
||||||
|
return *this;
|
||||||
|
|
||||||
// I cannot hand you a slice I don't have
|
// I cannot hand you a slice I don't have
|
||||||
VERIFY(offset + size <= this->size());
|
VERIFY(offset + size <= this->size());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue